diff options
Diffstat (limited to 'aptsources/sourceslist.py')
| -rw-r--r-- | aptsources/sourceslist.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/aptsources/sourceslist.py b/aptsources/sourceslist.py index fdc0f029..710bfe15 100644 --- a/aptsources/sourceslist.py +++ b/aptsources/sourceslist.py @@ -88,8 +88,8 @@ class SourceEntry: self.comment = "" # (optional) comment self.line = line # the original sources.list line if file is None: - file = apt_pkg.Config.FindDir( - "Dir::Etc")+apt_pkg.Config.Find("Dir::Etc::sourcelist") + file = apt_pkg.config.find_dir( + "Dir::Etc")+apt_pkg.config.find("Dir::Etc::sourcelist") self.file = file # the file that the entry is located in self.parse(line) self.template = None # type DistInfo.Suite @@ -237,10 +237,10 @@ class SourcesList(object): """ update the list of known entries """ self.list = [] # read sources.list - file = apt_pkg.Config.FindFile("Dir::Etc::sourcelist") + file = apt_pkg.config.find_file("Dir::Etc::sourcelist") self.load(file) # read sources.list.d - partsdir = apt_pkg.Config.FindDir("Dir::Etc::sourceparts") + partsdir = apt_pkg.config.find_dir("Dir::Etc::sourceparts") for file in glob.glob("%s/*.list" % partsdir): self.load(file) # check if the source item fits a predefined template @@ -312,12 +312,12 @@ class SourcesList(object): def restore_backup(self, backup_ext): " restore sources.list files based on the backup extension " - file = apt_pkg.Config.FindFile("Dir::Etc::sourcelist") + file = apt_pkg.config.find_file("Dir::Etc::sourcelist") if os.path.exists(file+backup_ext) and \ os.path.exists(file): shutil.copy(file+backup_ext, file) # now sources.list.d - partsdir = apt_pkg.Config.FindDir("Dir::Etc::sourceparts") + partsdir = apt_pkg.config.find_dir("Dir::Etc::sourceparts") for file in glob.glob("%s/*.list" % partsdir): if os.path.exists(file+backup_ext): shutil.copy(file+backup_ext, file) @@ -355,7 +355,7 @@ class SourcesList(object): files = {} # write an empty default config file if there aren't any sources if len(self.list) == 0: - path = apt_pkg.Config.FindFile("Dir::Etc::sourcelist") + path = apt_pkg.config.find_file("Dir::Etc::sourcelist") header = ( "## See sources.list(5) for more information, especialy\n" "# Remember that you can only use http, ftp or file URIs\n" @@ -433,7 +433,7 @@ class SourceEntryMatcher: # some simple tests if __name__ == "__main__": - apt_pkg.InitConfig() + apt_pkg.init_config() sources = SourcesList() for entry in sources: |
