diff options
| -rw-r--r-- | apt/__init__.py | 3 | ||||
| -rw-r--r-- | apt/cache.py | 6 | ||||
| -rw-r--r-- | apt/debfile.py | 18 | ||||
| -rw-r--r-- | apt/package.py | 16 | ||||
| -rw-r--r-- | apt/progress.py | 71 | ||||
| -rw-r--r-- | aptsources/distinfo.py | 10 | ||||
| -rw-r--r-- | aptsources/distro.py | 33 | ||||
| -rw-r--r-- | aptsources/sourceslist.py | 26 | ||||
| -rw-r--r-- | doc/examples/action.py | 3 | ||||
| -rw-r--r-- | doc/examples/all_deps.py | 6 | ||||
| -rwxr-xr-x | doc/examples/config.py | 3 | ||||
| -rwxr-xr-x | doc/examples/configisc.py | 9 | ||||
| -rw-r--r-- | doc/examples/depcache.py | 3 | ||||
| -rw-r--r-- | doc/examples/progress.py | 7 | ||||
| -rwxr-xr-x | doc/examples/records.py | 3 | ||||
| -rw-r--r-- | doc/examples/sources.py | 3 | ||||
| -rw-r--r-- | tests/depcache.py | 3 | ||||
| -rw-r--r-- | tests/pkgrecords.py | 4 | ||||
| -rw-r--r-- | tests/pkgsrcrecords.py | 4 | ||||
| -rw-r--r-- | tests/test_aptsources.py | 7 |
20 files changed, 149 insertions, 89 deletions
diff --git a/apt/__init__.py b/apt/__init__.py index c6a2ff39..05407aff 100644 --- a/apt/__init__.py +++ b/apt/__init__.py @@ -6,7 +6,8 @@ import os # import some fancy classes from apt.package import Package from apt.cache import Cache -from apt.progress import OpProgress, FetchProgress, InstallProgress, CdromProgress +from apt.progress import ( + OpProgress, FetchProgress, InstallProgress, CdromProgress) from apt.cdrom import Cdrom from apt_pkg import SizeToStr, TimeToStr, VersionCompare diff --git a/apt/cache.py b/apt/cache.py index 3c3a25e5..a43bd5d7 100644 --- a/apt/cache.py +++ b/apt/cache.py @@ -51,7 +51,8 @@ class Cache(object): self._callbacks = {} if rootdir: apt_pkg.Config.Set("Dir", rootdir) - apt_pkg.Config.Set("Dir::State::status", rootdir + "/var/lib/dpkg/status") + apt_pkg.Config.Set( + "Dir::State::status", rootdir + "/var/lib/dpkg/status") self.open(progress) def _runCallbacks(self, name): @@ -153,7 +154,8 @@ class Cache(object): if item.StatIdle: transient = True continue - errMsg += "Failed to fetch %s %s\n" % (item.DescURI, item.ErrorText) + errMsg += "Failed to fetch %s %s\n" % ( + item.DescURI, item.ErrorText) failed = True # we raise a exception if the download failed or it was cancelt diff --git a/apt/debfile.py b/apt/debfile.py index 1a64b833..ca82bbdb 100644 --- a/apt/debfile.py +++ b/apt/debfile.py @@ -22,7 +22,9 @@ class DebPackage(object): " open given debfile " self.filename = filename if not arCheckMember(open(self.filename), "debian-binary"): - raise NoDebArchiveException, _("This is not a valid DEB archive, missing '%s' member" % "debian-binary") + raise NoDebArchiveException, _( + "This is not a valid DEB archive, missing '%s' member" + % "debian-binary") control = apt_inst.debExtractControl(open(self.filename)) self._sections = apt_pkg.ParseSection(control) self.pkgname = self._sections["Package"] @@ -34,18 +36,22 @@ class DebPackage(object): """ return the list of files in the deb """ files = [] - def extract_cb(What, Name, Link, Mode, UID, GID, Size, MTime, Major, Minor): - #print "%s '%s','%s',%u,%u,%u,%u,%u,%u,%u"\ - # % (What, Name, Link, Mode, UID, GID, Size, MTime, Major, Minor) + def extract_cb( + What, Name, Link, Mode, UID, GID, Size, MTime, Major, Minor): + #print "%s '%s','%s',%u,%u,%u,%u,%u,%u,%u" % ( + # What, Name, Link, Mode, UID, GID, Size, MTime, Major, Minor) files.append(Name) for member in self._supported_data_members: if arCheckMember(open(self.filename), member): try: - apt_inst.debExtract(open(self.filename), extract_cb, member) + apt_inst.debExtract( + open(self.filename), extract_cb, member) break except SystemError, e: - return [_("List of files for '%s'could not be read" % self.filename)] + return [_( + "List of files for '%s'could not be read" + % self.filename)] return files filelist = property(filelist) diff --git a/apt/package.py b/apt/package.py index 51986874..e51ab98f 100644 --- a/apt/package.py +++ b/apt/package.py @@ -96,7 +96,8 @@ class Package(object): # check if we found a version if ver == None: - #print "No version for: %s (Candidate: %s)" % (self._pkg.Name, UseCandidate) + #print "No version for: %s (Candidate: %s)" % ( + # self._pkg.Name, UseCandidate) return False if ver.FileList == None: @@ -150,7 +151,10 @@ class Package(object): for depVerList in depends[t]: base_deps = [] for depOr in depVerList: - base_deps.append(BaseDependency(depOr.TargetPkg.Name, depOr.CompType, depOr.TargetVer, (t == "PreDepends"))) + base_deps.append( + BaseDependency( + depOr.TargetPkg.Name, depOr.CompType, + depOr.TargetVer, (t == "PreDepends"))) depends_list.append(Dependency(base_deps)) return depends_list @@ -441,7 +445,9 @@ class Package(object): self.markInstall() else: # FIXME: we may want to throw a exception here - sys.stderr.write("MarkUpgrade() called on a non-upgrable pkg: '%s'\n" % self._pkg.Name) + sys.stderr.write( + "MarkUpgrade() called on a non-upgrable pkg: '%s'\n" + % self._pkg.Name) def commit(self, fprogress, iprogress): """ commit the changes, need a FetchProgress and InstallProgress @@ -478,7 +484,9 @@ if __name__ == "__main__": print "PackageSize: %s " % pkg.packageSize print "Dependencies: %s" % pkg.installedDependencies for dep in pkg.candidateDependencies: - print ",".join(["%s (%s) (%s) (%s)" % (o.name, o.version, o.relation, o.preDepend) for o in dep.or_dependencies]) + print ",".join( + ["%s (%s) (%s) (%s)" % (o.name, o.version, o.relation, o.preDepend) + for o in dep.or_dependencies]) print "arch: %s" % pkg.architecture print "homepage: %s" % pkg.homepage print "rec: ", pkg.candidateRecord diff --git a/apt/progress.py b/apt/progress.py index 1f2d4e7c..96112d73 100644 --- a/apt/progress.py +++ b/apt/progress.py @@ -95,9 +95,13 @@ class FetchProgress(object): """ called periodically (to update the gui), importend to return True to continue or False to cancel """ - self.percent = ((self.currentBytes + self.currentItems)*100.0)/float(self.totalBytes+self.totalItems) + self.percent = ( + ((self.currentBytes + self.currentItems) * 100.0) + / float(self.totalBytes+self.totalItems)) if self.currentCPS > 0: - self.eta = (self.totalBytes-self.currentBytes)/float(self.currentCPS) + self.eta = ( + (self.totalBytes - self.currentBytes) + / float(self.currentCPS)) return True def mediaChange(self, medium, drive): @@ -193,38 +197,41 @@ class InstallProgress(DumbInstallProgress): def updateInterface(self): if self.statusfd != None: + try: + while not self.read.endswith("\n"): + self.read += os.read(self.statusfd.fileno(), 1) + except OSError, (errno, errstr): + # resource temporarly unavailable is ignored + if errno != EAGAIN and errnor != EWOULDBLOCK: + print errstr + if self.read.endswith("\n"): + s = self.read + #print s try: - while not self.read.endswith("\n"): - self.read += os.read(self.statusfd.fileno(), 1) - except OSError, (errno, errstr): - # resource temporarly unavailable is ignored - if errno != EAGAIN and errnor != EWOULDBLOCK: - print errstr - if self.read.endswith("\n"): - s = self.read - #print s - try: - (status, pkg, percent, status_str) = string.split(s, ":", 3) - except ValueError, e: - # silently ignore lines that can't be parsed - self.read = "" - return - #print "percent: %s %s" % (pkg, float(percent)/100.0) - if status == "pmerror": - self.error(pkg, status_str) - elif status == "pmconffile": - # we get a string like this: - # 'current-conffile' 'new-conffile' useredited distedited - match = re.compile("\s*\'(.*)\'\s*\'(.*)\'.*").match(status_str) - if match: - self.conffile(match.group(1), match.group(2)) - elif status == "pmstatus": - if float(percent) != self.percent or \ - status_str != self.status: - self.statusChange(pkg, float(percent), status_str.strip()) - self.percent = float(percent) - self.status = string.strip(status_str) + (status, pkg, percent, status_str) = string.split( + s, ":", 3) + except ValueError, e: + # silently ignore lines that can't be parsed self.read = "" + return + #print "percent: %s %s" % (pkg, float(percent)/100.0) + if status == "pmerror": + self.error(pkg, status_str) + elif status == "pmconffile": + # we get a string like this: + # 'current-conffile' 'new-conffile' useredited distedited + match = re.compile( + "\s*\'(.*)\'\s*\'(.*)\'.*").match(status_str) + if match: + self.conffile(match.group(1), match.group(2)) + elif status == "pmstatus": + if float(percent) != self.percent or \ + status_str != self.status: + self.statusChange( + pkg, float(percent), status_str.strip()) + self.percent = float(percent) + self.status = string.strip(status_str) + self.read = "" def fork(self): return os.fork() diff --git a/aptsources/distinfo.py b/aptsources/distinfo.py index ce90faac..3bdbd653 100644 --- a/aptsources/distinfo.py +++ b/aptsources/distinfo.py @@ -154,7 +154,9 @@ class DistInfo: location = None match_loc = re.compile(r"^#LOC:(.+)$") - match_mirror_line = re.compile(r"^(#LOC:.+)|(((http)|(ftp)|(rsync)|(file)|(https))://[A-Za-z/\.:\-_]+)$") + match_mirror_line = re.compile( + r"^(#LOC:.+)|(((http)|(ftp)|(rsync)|(file)|(https))://" + r"[A-Za-z/\.:\-_]+)$") #match_mirror_line = re.compile(r".+") if not dist: @@ -185,7 +187,8 @@ class DistInfo: self.metarelease_uri = value elif field == 'Suite': if template: - if component and not template.has_component(component.name): + if component \ + and not template.has_component(component.name): template.components.append(component) component = None self.templates.append(template) @@ -231,7 +234,8 @@ class DistInfo: if mirror_set.has_key(hostname): mirror_set[hostname].add_repository(proto, dir) else: - mirror_set[hostname] = Mirror(proto, hostname, dir, location) + mirror_set[hostname] = Mirror( + proto, hostname, dir, location) map_mirror_sets[value] = mirror_set template.mirror_set = map_mirror_sets[value] elif field == 'Description': diff --git a/aptsources/distro.py b/aptsources/distro.py index 888e6e06..f631e285 100644 --- a/aptsources/distro.py +++ b/aptsources/distro.py @@ -82,7 +82,8 @@ class Distribution: if self.is_codename(template.name) and\ template.distribution == self.id: #print "yeah! found a template for %s" % self.description - #print template.description, template.base_uri, template.components + #print template.description, template.base_uri, \ + # template.components self.source_template = template break if self.source_template == None: @@ -117,15 +118,19 @@ class Distribution: elif source.type == self.binary_type and \ source.disabled == True: self.disabled_sources.append(source) - elif source.type == self.source_type and source.disabled == False: + elif source.type == self.source_type \ + and source.disabled == False: self.source_code_sources.append(source) - elif source.type == self.source_type and source.disabled == True: + elif source.type == self.source_type \ + and source.disabled == True: self.disabled_sources.append(source) if source.invalid == False and\ source.template in self.source_template.children: - if source.disabled == False and source.type == self.binary_type: + if source.disabled == False \ + and source.type == self.binary_type: self.child_sources.append(source) - elif source.disabled == False and source.type == self.source_type: + elif source.disabled == False \ + and source.type == self.source_type: self.source_code_sources.append(source) else: self.disabled_sources.append(source) @@ -240,11 +245,12 @@ class Distribution: self.nearest_server, False]) mirrors.append([_("Custom servers"), None, True]) for server in self.used_servers: + mirror_entry = [self._get_mirror_name(server), server, False] if compare_mirrors(server, self.nearest_server) or\ compare_mirrors(server, self.main_server): continue - elif not [self._get_mirror_name(server), server, False] in mirrors: - mirrors.append([self._get_mirror_name(server), server, False]) + elif not mirror_entry in mirrors: + mirrors.append(mirror_entry) return mirrors @@ -408,23 +414,22 @@ class DebianDistribution(Distribution): country = server[i+len("://ftp."):l] if self.countries.has_key(country): # TRANSLATORS: %s is a country - return _("Server for %s") % \ - gettext.dgettext("iso_3166", - self.countries[country].rstrip()).rstrip() + return _("Server for %s") % gettext.dgettext( + "iso_3166", self.countries[country].rstrip()).rstrip() else: return("%s" % server.rstrip("/ ")) def get_mirrors(self): - Distribution.get_mirrors(self, - mirror_template="http://ftp.%s.debian.org/debian/") + Distribution.get_mirrors( + self, mirror_template="http://ftp.%s.debian.org/debian/") class UbuntuDistribution(Distribution): ''' Class to support specific Ubuntu features ''' def get_mirrors(self): - Distribution.get_mirrors(self, - mirror_template="http://%s.archive.ubuntu.com/ubuntu/") + Distribution.get_mirrors( + self, mirror_template="http://%s.archive.ubuntu.com/ubuntu/") def get_distro(): diff --git a/aptsources/sourceslist.py b/aptsources/sourceslist.py index 6eb69f6e..be17cd1f 100644 --- a/aptsources/sourceslist.py +++ b/aptsources/sourceslist.py @@ -84,11 +84,13 @@ class SourceEntry: self.type = "" # what type (deb, deb-src) self.uri = "" # base-uri self.dist = "" # distribution (dapper, edgy, etc) - self.comps = [] # list of available componetns (may empty) + self.comps = [] # list of available componetns + # (may empty) self.comment = "" # (optional) comment self.line = line # the original sources.list line if file == None: - file = apt_pkg.Config.FindDir("Dir::Etc")+apt_pkg.Config.Find("Dir::Etc::sourcelist") + file = apt_pkg.Config.FindDir( + "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 @@ -118,11 +120,13 @@ class SourceEntry: elif line[i] == "]": p_found=False tmp += line[i] - elif space_found and not line[i].isspace(): # we skip one or more space + elif space_found and not line[i].isspace(): + # we skip one or more space space_found = False pieces.append(tmp) tmp = line[i] - elif line[i].isspace() and not p_found: # found a whitespace + elif line[i].isspace() and not p_found: + # found a whitespace space_found = True else: tmp += line[i] @@ -273,8 +277,8 @@ class SourcesList: source.dist == dist: for new_comp in comps: if new_comp in source.comps: - # we have this component already, delete it from the new_comps - # list + # we have this component already, delete it + # from the new_comps list del comps[comps.index(new_comp)] if len(comps) == 0: return source @@ -332,7 +336,8 @@ class SourcesList: if backup_ext == None: backup_ext = time.strftime("%y%m%d.%H%M") for source in self.list: - if not source.file in already_backuped and os.path.exists(source.file): + if not source.file in already_backuped \ + and os.path.exists(source.file): shutil.copy(source.file, "%s%s" % (source.file, backup_ext)) return backup_ext @@ -356,9 +361,10 @@ class SourcesList: if len(self.list) == 0: path = "%s%s" % (apt_pkg.Config.FindDir("Dir::Etc"), apt_pkg.Config.Find("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" - "# CDROMs are managed through the apt-cdrom tool.\n") + header = ( + "## See sources.list(5) for more information, especialy\n" + "# Remember that you can only use http, ftp or file URIs\n" + "# CDROMs are managed through the apt-cdrom tool.\n") open(path, "w").write(header) return for source in self.list: diff --git a/doc/examples/action.py b/doc/examples/action.py index 9277129e..7153292c 100644 --- a/doc/examples/action.py +++ b/doc/examples/action.py @@ -86,7 +86,8 @@ print "UsrSize: %s " % apt_pkg.SizeToStr(depcache.UsrSize) print "DebSize: %s " % apt_pkg.SizeToStr(depcache.DebSize) for pkg in cache.Packages: - if pkg.CurrentVer != None and not depcache.MarkedInstall(pkg) and depcache.IsUpgradable(pkg): + if pkg.CurrentVer != None and not depcache.MarkedInstall(pkg) \ + and depcache.IsUpgradable(pkg): print "Upgrade didn't upgrade (kept): %s" % pkg.Name print "\nPerforming DistUpgrade" diff --git a/doc/examples/all_deps.py b/doc/examples/all_deps.py index 37222463..2feeb125 100644 --- a/doc/examples/all_deps.py +++ b/doc/examples/all_deps.py @@ -14,9 +14,11 @@ def dependencies(cache, pkg, deps, key="Depends"): for depVerList in dependslist[key]:
for dep in depVerList:
if cache.has_key(dep.TargetPkg.Name):
- if pkg.name != dep.TargetPkg.Name and not dep.TargetPkg.Name in deps:
+ if pkg.name != dep.TargetPkg.Name and \
+ not dep.TargetPkg.Name in deps:
deps.add(dep.TargetPkg.Name)
- dependencies(cache, cache[dep.TargetPkg.Name], deps, key)
+ dependencies(
+ cache, cache[dep.TargetPkg.Name], deps, key)
return deps
diff --git a/doc/examples/config.py b/doc/examples/config.py index d0895690..cc1aae44 100755 --- a/doc/examples/config.py +++ b/doc/examples/config.py @@ -6,7 +6,8 @@ # config.py -no-h --no-help --help=no ; Turn off help # config.py -qqq -q=3 ; verbosity to 3 # config.py -c /etc/apt/apt.conf ; include that config file] -# config.py -o help=true ; Turn on help by giving a config file string +# config.py -o help=true ; Turn on help by giving a +# ; config file string # config.py -no-h -- -help ; Turn off help, specify the file '-help' # -c and -o are standard APT-program options. diff --git a/doc/examples/configisc.py b/doc/examples/configisc.py index 03fa2cad..1d5965f5 100755 --- a/doc/examples/configisc.py +++ b/doc/examples/configisc.py @@ -32,10 +32,13 @@ if Cnf.has_key("Zone"): for I in Cnf.List("zone"): SubCnf = Cnf.SubTree(I) if SubCnf.Find("type") == "slave": - print "Masters for %s: %s" % (SubCnf.MyTag(), SubCnf.ValueList("masters")) + print "Masters for %s: %s" % ( + SubCnf.MyTag(), SubCnf.ValueList("masters")) else: print "Tree definitions:" for I in Cnf.List("tree"): SubCnf = Cnf.SubTree(I) - # This could use Find which would eliminate the possibility of exceptions. - print "Subtree %s with sections '%s' and architectures '%s'" % (SubCnf.MyTag(), SubCnf["Sections"], SubCnf["Architectures"]) + # This could use Find which would eliminate the possibility of + # exceptions. + print "Subtree %s with sections '%s' and architectures '%s'" % ( + SubCnf.MyTag(), SubCnf["Sections"], SubCnf["Architectures"]) diff --git a/doc/examples/depcache.py b/doc/examples/depcache.py index 556c954b..ad884fe7 100644 --- a/doc/examples/depcache.py +++ b/doc/examples/depcache.py @@ -84,7 +84,8 @@ print "UsrSize: %s " % apt_pkg.SizeToStr(depcache.UsrSize) print "DebSize: %s " % apt_pkg.SizeToStr(depcache.DebSize) for pkg in cache.Packages: - if pkg.CurrentVer != None and not depcache.MarkedInstall(pkg) and depcache.IsUpgradable(pkg): + if pkg.CurrentVer != None and not depcache.MarkedInstall(pkg) \ + and depcache.IsUpgradable(pkg): print "Upgrade didn't upgrade (kept): %s" % pkg.Name diff --git a/doc/examples/progress.py b/doc/examples/progress.py index 70fc92f3..c56734b7 100644 --- a/doc/examples/progress.py +++ b/doc/examples/progress.py @@ -34,10 +34,13 @@ class TextFetchProgress(apt.FetchProgress): pass def updateStatus(self, uri, descr, shortDescr, status): - print "UpdateStatus: '%s' '%s' '%s' '%i'" % (uri, descr, shortDescr, status) + print "UpdateStatus: '%s' '%s' '%s' '%i'" % ( + uri, descr, shortDescr, status) def pulse(self): - print "Pulse: CPS: %s/s; Bytes: %s/%s; Item: %s/%s" % (SizeToStr(self.currentCPS), SizeToStr(self.currentBytes), SizeToStr(self.totalBytes), self.currentItems, self.totalItems) + print "Pulse: CPS: %s/s; Bytes: %s/%s; Item: %s/%s" % ( + SizeToStr(self.currentCPS), SizeToStr(self.currentBytes), + SizeToStr(self.totalBytes), self.currentItems, self.totalItems) return True def mediaChange(self, medium, drive): diff --git a/doc/examples/records.py b/doc/examples/records.py index 9dfc460b..a7a87727 100755 --- a/doc/examples/records.py +++ b/doc/examples/records.py @@ -8,5 +8,6 @@ for pkg in cache: if not pkg.candidateRecord: continue if pkg.candidateRecord.has_key("Task"): - print "Pkg %s is part of '%s'" % (pkg.name, pkg.candidateRecord["Task"].split()) + print "Pkg %s is part of '%s'" % ( + pkg.name, pkg.candidateRecord["Task"].split()) #print pkg.candidateRecord diff --git a/doc/examples/sources.py b/doc/examples/sources.py index 8d807f4c..49652982 100644 --- a/doc/examples/sources.py +++ b/doc/examples/sources.py @@ -10,6 +10,7 @@ apt_pkg.init() sources = apt_pkg.GetPkgSrcRecords() sources.Restart() while sources.Lookup('hello'): - print sources.Package, sources.Version, sources.Maintainer, sources.Section, `sources.Binaries` + print sources.Package, sources.Version, sources.Maintainer, \ + sources.Section, `sources.Binaries` print sources.Files print sources.Index.ArchiveURI(sources.Files[0][2]) diff --git a/tests/depcache.py b/tests/depcache.py index 5ed54895..b199c812 100644 --- a/tests/depcache.py +++ b/tests/depcache.py @@ -31,7 +31,8 @@ def main(): if depcache.MarkedInstall(p): depcache.MarkKeep(p) if depcache.InstCount != 0: - print "Error undoing the selection for %s (InstCount: %s)" % (x, depcache.InstCount) + print "Error undoing the selection for %s (InstCount: %s)" % ( + x, depcache.InstCount) print "\r%i/%i=%.3f%% " % (i, all, (float(i) / float(all) * 100)), print diff --git a/tests/pkgrecords.py b/tests/pkgrecords.py index e128237b..5866847d 100644 --- a/tests/pkgrecords.py +++ b/tests/pkgrecords.py @@ -30,7 +30,9 @@ def main(): x = records.FileName y = records.LongDesc pass - print "\r%i/%i=%.3f%% " % (i, cache.PackageCount, (float(i) / float(cache.PackageCount) * 100)), + print "\r%i/%i=%.3f%% " % ( + i, cache.PackageCount, + (float(i) / float(cache.PackageCount) * 100)), if __name__ == "__main__": diff --git a/tests/pkgsrcrecords.py b/tests/pkgsrcrecords.py index 6e78858b..77670540 100644 --- a/tests/pkgsrcrecords.py +++ b/tests/pkgsrcrecords.py @@ -19,7 +19,9 @@ def main(): if src.Lookup(x.Name): #print src.Package pass - print "\r%i/%i=%.3f%% " % (i, cache.PackageCount, (float(i) / float(cache.PackageCount) * 100)), + print "\r%i/%i=%.3f%% " % ( + i, cache.PackageCount, + (float(i) / float(cache.PackageCount) * 100)), if __name__ == "__main__": diff --git a/tests/test_aptsources.py b/tests/test_aptsources.py index 9019aa2d..3e2f7ac5 100644 --- a/tests/test_aptsources.py +++ b/tests/test_aptsources.py @@ -79,7 +79,8 @@ class TestAptSources(unittest.TestCase): self.assertEqual(found_universe, 1) def testDistribution(self): - apt_pkg.Config.Set("Dir::Etc::sourcelist", "data/sources.list.testDistribution") + apt_pkg.Config.Set( + "Dir::Etc::sourcelist", "data/sources.list.testDistribution") sources = aptsources.SourcesList() distro = aptsources.Distribution() distro.get_sources(sources) @@ -89,7 +90,9 @@ class TestAptSources(unittest.TestCase): if s.template: dist_templates.add(s.template.name) #print dist_templates - for d in ["edgy", "edgy-security", "edgy-updates", "hoary", "breezy", "breezy-backports"]: + for d in [ + "edgy", "edgy-security", "edgy-updates", + "hoary", "breezy", "breezy-backports"]: self.assertTrue(d in dist_templates) # test enable comp = "restricted" |
