Author: fw Date: 2007-12-25 16:57:24 +0000 (Tue, 25 Dec 2007) New Revision: 7715 Modified: lib/python/bugs.py Log: Remove unused methods The following methods are removed: bugs.PackageNote.affects bugs.PackageNote.affectsKernel bugs.PackageNote.fixedVersion bugs.PackageNote.sourceStatus bugs.BugBase.hasTODO bugs.BugBase.isKernelOnly Modified: lib/python/bugs.py ==================================================================--- lib/python/bugs.py 2007-12-25 15:52:17 UTC (rev 7714) +++ lib/python/bugs.py 2007-12-25 16:57:24 UTC (rev 7715) @@ -69,69 +69,6 @@ self.package_kind = "unknown" self.bug_origin = None - def affects(self, version, release=None): - """Returns true if this package note affects the given version. - - Both version and release can be strings. In this case, they - are automatically promoted to the correct Python objects. - """ - - if type(version) == types.StringType: - version = debian_support.Version(version) - if type(release) == types.StringType: - release = Release(release) - - if release is None: - if self.release is not None: - # If there''s a release spec, and we are running for - # testing, this note does apply. - return False - else: - if self.release is not None and self.release <> release: - # If there''s a release spec, it must match ours. - return False - # Standard version comparison if the releases match. - return self.fixed_version is None or version < self.fixed_version - - def affectsKernel(self, regexp=re.compile - (r''^kernel-(?:source|image|patch)-[0-9.]{3}'')): - """Crude check if this is a kernel package.""" - return regexp.match(self.package) is not None - - def fixedVersion(self): - """ Returns a string noting that the bug was fixed, or ''unfixed''.""" - if self.fixed_version: - return "fixed in %s" % self.fixed_version - else: - return "unfixed" - - def sourceStatus(self, cursor): - """Returns a pair of lists (VERSION, RELEASE-LIST). - - The first one is the list with the vulnerable versions, the - second one contains fixed versions. - """ - - vulnerable_versions = {} - fixed_versions = {} - for (release, archive, version, vulnerable) in cursor.execute( - """SELECT p.release, p.archive, p.version, s.vulnerable - FROM source_package_status AS s, source_packages AS p - WHERE s.note = ? AND p.rowid = s.package""", (self.id,)): - if vulnerable: - versions = vulnerable_versions - else: - versions = fixed_versions - if not versions.has_key(version): - versions[version] = [] - versions[version].append((release, archive)) - - def sort(versions): - l = map(debian_support.Version, versions.keys()) - l.sort() - return map(lambda ver: (ver, versions[str(ver)]), l) - return (sort(vulnerable_versions), sort(fixed_versions)) - def writeDB(self, cursor, bug_name, bug_origin=''''): """Writes the object to an SQLite database.""" @@ -275,22 +212,6 @@ else: return '''' - def hasTODO(self): - """Returns True if the bug has a TODO item.""" - for (t, c) in self.comments: - if t == "TODO": - return True - return False - - def isKernelOnly(self): - """Returns True if this bug contains notes which refer to kernels.""" - if len(self.notes) == 0: - return False - for n in self.notes: - if not n.affectsKernel(): - return False - return True - def writeDB(self, cursor): """Writes the record to an SQLite3 database."""