diff options
| -rw-r--r-- | aptsources/distro.py | 26 | ||||
| -rw-r--r-- | doc/examples/acquire.py | 2 | ||||
| -rw-r--r-- | tests/test_aptsources.py | 4 |
3 files changed, 16 insertions, 16 deletions
diff --git a/aptsources/distro.py b/aptsources/distro.py index a71d5af2..9b48a10f 100644 --- a/aptsources/distro.py +++ b/aptsources/distro.py @@ -95,40 +95,40 @@ class Distribution(object): enabled_comps = [] #source_code = [] for source in self.sourceslist.list: - if (source.invalid is False and + if (not source.invalid and self.is_codename(source.dist) and source.template and - source.template.official is True and + source.template.official and self.is_codename(source.template.name)): #print "yeah! found a distro repo: %s" % source.line # cdroms need do be handled differently if (source.uri.startswith("cdrom:") and - source.disabled is False): + not source.disabled): self.cdrom_sources.append(source) cdrom_comps.extend(source.comps) elif (source.uri.startswith("cdrom:") and - source.disabled is True): + source.disabled): self.cdrom_sources.append(source) elif (source.type == self.binary_type and - source.disabled is False): + not source.disabled): self.main_sources.append(source) comps.extend(source.comps) media.append(source.uri) elif (source.type == self.binary_type and - source.disabled is True): + source.disabled): self.disabled_sources.append(source) elif (source.type == self.source_type - and source.disabled is False): + and not source.disabled): self.source_code_sources.append(source) elif (source.type == self.source_type and - source.disabled is True): + source.disabled): self.disabled_sources.append(source) - if (source.invalid is False and + if (not source.invalid and source.template in self.source_template.children): - if (source.disabled is False + if (not source.disabled and source.type == self.binary_type): self.child_sources.append(source) - elif (source.disabled is False + elif (not source.disabled and source.type == self.source_type): self.source_code_sources.append(source) else: @@ -280,7 +280,7 @@ class Distribution(object): new_source = self.sourceslist.add(type, uri, dist, comps, comment) # if source code is enabled add a deb-src line after the new # source - if self.get_source_code is True and type == self.binary_type: + if self.get_source_code and type == self.binary_type: self.sourceslist.add( self.source_type, uri, dist, comps, comment, file=new_source.file, @@ -355,7 +355,7 @@ class Distribution(object): add_component_only_once(source, comps_per_sdist) # check if there is a main source code source at all - if self.get_source_code is True: + if self.get_source_code: if len(self.source_code_sources) < 1: # create a new main source self.add_source(type=self.source_type, comps=["%s" % comp]) diff --git a/doc/examples/acquire.py b/doc/examples/acquire.py index 1971ba2f..942d0686 100644 --- a/doc/examples/acquire.py +++ b/doc/examples/acquire.py @@ -66,7 +66,7 @@ for item in fetcher.items: print item if item.status == item.STAT_ERROR: print "Some error ocured: '%s'" % item.error_text - if item.complete is False: + if not item.complete: print "No error, still nothing downloaded (%s)" % item.error_text print diff --git a/tests/test_aptsources.py b/tests/test_aptsources.py index 4539b2d1..e6d0bd82 100644 --- a/tests/test_aptsources.py +++ b/tests/test_aptsources.py @@ -149,14 +149,14 @@ class TestAptSources(unittest.TestCase): apt_pkg.config.set("Dir::Etc::sourcelist", "data/aptsources/" "sources.list") sources = aptsources.sourceslist.SourcesList(True, self.templates) - assert sources.list[8].invalid is False + assert not sources.list[8].invalid assert sources.list[8].type == "deb" assert sources.list[8].architectures == ["amd64", "i386"] assert sources.list[8].uri == "http://de.archive.ubuntu.com/ubuntu/" assert sources.list[8].dist == "natty" assert sources.list[8].comps == ["main"] assert sources.list[8].line.strip() == str(sources.list[8]) - assert sources.list[8].trusted is None + assert not sources.list[8].trusted def testMultipleOptions(self): """aptsources: Test multi-arch parsing""" |
