From: Zac Medico Date: Thu, 28 Feb 2013 00:24:54 +0000 (-0800) Subject: _display_use: use local variables X-Git-Tag: v2.2.0_alpha164~5 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3507aa783cdf93fd28a58fb32df2fe7e03c46330;p=portage.git _display_use: use local variables --- diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py index 1ebb24878..9e383e262 100644 --- a/pym/_emerge/resolver/output.py +++ b/pym/_emerge/resolver/output.py @@ -58,11 +58,6 @@ class Display(object): self.oldlp = None self.myfetchlist = None self.indent = '' - self.is_new = True - self.cur_use = None - self.cur_iuse = None - self.old_use = '' - self.old_iuse = '' self.use_expand = None self.use_expand_hidden = None self.pkgsettings = None @@ -185,28 +180,28 @@ class Display(object): @param pkg: _emerge.Package.Package instance @param pkg_info: PkgInfo instance Modifies self.use_expand_hidden, self.use_expand, self.verboseadd, - self.forced_flags, self.cur_iuse, self.old_iuse, self.old_use + self.forced_flags """ self.forced_flags = set() self.forced_flags.update(pkg.use.force) self.forced_flags.update(pkg.use.mask) - self.cur_use = [flag for flag in self.conf.pkg_use_enabled(pkg) \ + cur_use = [flag for flag in self.conf.pkg_use_enabled(pkg) \ if flag in pkg.iuse.all] - self.cur_iuse = sorted(pkg.iuse.all) + cur_iuse = sorted(pkg.iuse.all) if pkg_info.previous_pkg is not None: previous_pkg = pkg_info.previous_pkg - self.old_iuse = sorted(previous_pkg.iuse.all) - self.old_use = previous_pkg.use.enabled - self.is_new = False + old_iuse = sorted(previous_pkg.iuse.all) + old_use = previous_pkg.use.enabled + is_new = False else: - self.old_iuse = [] - self.old_use = [] - self.is_new = True + old_iuse = [] + old_use = [] + is_new = True - self.old_use = [flag for flag in self.old_use if flag in self.old_iuse] + old_use = [flag for flag in old_use if flag in old_iuse] self.use_expand = pkg.use.expand self.use_expand_hidden = pkg.use.expand_hidden @@ -233,10 +228,10 @@ class Display(object): reinst_expand_map) cur_iuse_map, iuse_forced = \ - self.map_to_use_expand(self.cur_iuse, forced_flags=True) - cur_use_map = self.map_to_use_expand(self.cur_use) - old_iuse_map = self.map_to_use_expand(self.old_iuse) - old_use_map = self.map_to_use_expand(self.old_use) + self.map_to_use_expand(cur_iuse, forced_flags=True) + cur_use_map = self.map_to_use_expand(cur_use) + old_iuse_map = self.map_to_use_expand(old_iuse) + old_use_map = self.map_to_use_expand(old_use) use_expand = sorted(self.use_expand) use_expand.insert(0, "USE") @@ -248,7 +243,7 @@ class Display(object): self.verboseadd += _create_use_string(self.conf, key.upper(), cur_iuse_map[key], iuse_forced[key], cur_use_map[key], old_iuse_map[key], - old_use_map[key], self.is_new, feature_flags, + old_use_map[key], is_new, feature_flags, reinst_flags_map.get(key)) return