diff options
author | 2010-11-22 19:19:02 +0000 | |
---|---|---|
committer | 2010-11-22 19:19:02 +0000 | |
commit | 6f8698acc92f3e3e4ba8395c04390086d6b7f180 (patch) | |
tree | 95e5a9da06a9d17746eefc94d591b2ade2d3a809 | |
parent | Run the keywords check only if the keywords are not empty. (diff) | |
download | gentoolkit-6f8698acc92f3e3e4ba8395c04390086d6b7f180.tar.gz gentoolkit-6f8698acc92f3e3e4ba8395c04390086d6b7f180.tar.bz2 gentoolkit-6f8698acc92f3e3e4ba8395c04390086d6b7f180.zip |
Move useless variable passing.
svn path=/trunk/gentoolkit/; revision=864
-rw-r--r-- | pym/gentoolkit/eshowkw/keywords_content.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/pym/gentoolkit/eshowkw/keywords_content.py b/pym/gentoolkit/eshowkw/keywords_content.py index 9ca6c4d..911c2ae 100644 --- a/pym/gentoolkit/eshowkw/keywords_content.py +++ b/pym/gentoolkit/eshowkw/keywords_content.py @@ -87,14 +87,14 @@ class keywords_content: self.redundant = self.__listRedundant(keywords, ignore_slots, slots) class VersionChecker: - def __getVersions(self, packages, vartree): + def __getVersions(self, packages): """Obtain properly aligned version strings without colors.""" - return map(lambda x: self.__separateVersion(x, vartree), packages) + return map(lambda x: self.__separateVersion(x), packages) - def __separateVersion(self, cpv, vartree): + def __separateVersion(self, cpv): """Get version string for specfied cpv""" #pv = port.versions.cpv_getversion(cpv) - return self.__prependVersionInfo(cpv, self.cpv_getversion(cpv), vartree) + return self.__prependVersionInfo(cpv, self.cpv_getversion(cpv)) # remove me when portage 2.1.9 is stable def cpv_getversion(self, mycpv): @@ -104,10 +104,10 @@ class keywords_content: return None return mycpv[len(cp+"-"):] - def __prependVersionInfo(self, cpv, pv, vartree): + def __prependVersionInfo(self, cpv, pv): """Prefix version with string based on whether version is installed or masked.""" mask = self.__getMaskStatus(cpv) - install = self.__getInstallStatus(cpv, vartree) + install = self.__getInstallStatus(cpv) if mask and install: pv = '[M][I]%s' % pv @@ -131,13 +131,14 @@ class keywords_content: pass return False - def __getInstallStatus(self, cpv, vartree): + def __getInstallStatus(self, cpv): """Check if package version we test is installed.""" + vartree = port.db[port.settings['ROOT']]['vartree'].dbapi return vartree.cpv_exists(cpv) - def __init__(self, packages, vartree): + def __init__(self, packages): """Query all relevant data for version data formatting""" - self.versions = self.__getVersions(packages, vartree) + self.versions = self.__getVersions(packages) def __checkExist(self, pdb, package): """Check if specified package even exists.""" @@ -248,13 +249,12 @@ class keywords_content: def __init__(self, package, keywords_list, porttree, ignoreslots = False, content_align = 'bottom', usebold = False, toplist = 'archlist'): """Query all relevant data from portage databases.""" - vartree = port.db[port.settings['ROOT']]['vartree'].dbapi packages = self.__checkExist(porttree, package) self.keywords, self.slots, self.repositories = self.__getMetadata(porttree, packages) self.slot_length = max([len(x) for x in self.slots]) repositories_length = max([len(x) for x in self.repositories]) self.keyword_length = len(keywords_list) - self.versions = self.VersionChecker(packages, vartree).versions + self.versions = self.VersionChecker(packages).versions self.version_length = max([len(x) for x in self.versions]) self.version_count = len(self.versions) self.redundant = self.RedundancyChecker(self.keywords, self.slots, ignoreslots).redundant |