class Display(object):
"""Formats and outputs the depgrah supplied it for merge/re-merge, etc.
-
+
__call__()
@param depgraph: list
@param favorites: defaults to []
def _blockers(self, pkg, fetch_symbol):
"""Processes pkg for blockers and adds colorized strings to
self.print_msg and self.blockers
-
+
@param pkg: _emerge.Package instance
@param fetch_symbol: string
@rtype: bool
addl = "%s %s " % (colorize(self.blocker_style, "B"),
fetch_symbol)
self.resolved = dep_expand(
- str(pkg.atom).lstrip("!"), mydb=self.vardb,
+ str(pkg.atom).lstrip("!"), mydb=self.vardb,
settings=self.pkgsettings
)
if self.conf.columns and self.conf.quiet:
else:
addl = "[%s %s] %s%s" % \
(colorize(self.blocker_style, "blocks"),
- addl, self.indent,
+ addl, self.indent,
colorize(self.blocker_style, str(self.resolved))
)
block_parents = self.conf.blocker_parents.parent_nodes(pkg)
def _display_use(self, pkg, myoldbest, myinslotlist):
""" USE flag display
-
+
@param pkg: _emerge.Package instance
@param myoldbest: list of installed versions
@param myinslotlist: list of installed slots
Modifies class globals: self.forced_flags, self.cur_iuse,
self.old_iuse, self.old_use, self.use_expand
"""
-
+
self.forced_flags = set()
self.forced_flags.update(pkg.use.force)
self.forced_flags.update(pkg.use.mask)
def _display_keyword(self, pkg):
""" keyword display
-
+
@param pkg: _emerge.Package instance
Modifies self.verboseadd
"""
used_keyword = pkg.accepted_keyword()
hardmasked = pkg.isHardMasked()
- text = ''
- if '~' in used_keyword:
- text = used_keyword
- elif not used_keyword:
- text = '**'
- if text:
+ if used_keyword:
if hardmasked:
- self.verboseadd += red('%s ' % text)
+ self.verboseadd += 'keyword=' + red('[%s] ' % used_keyword)
else:
- self.verboseadd += yellow('%s ' % text)
+ self.verboseadd += 'keyword=' + yellow('%s ' % used_keyword)
return
def map_to_use_expand(self, myvals, forced_flags=False,
remove_hidden=True):
"""Map use expand variables
-
+
@param myvals: list
@param forced_flags: bool
@param remove_hidden: bool
- @rtype ret dictionary
+ @rtype ret dictionary
or ret dict, forced dict.
"""
ret = {}
def recheck_hidden(self, pkg):
""" Prevent USE_EXPAND_HIDDEN flags from being hidden if they
are the only thing that triggered reinstallation.
-
+
@param pkg: _emerge.Package instance
Modifies self.use_expand_hidden, self.use_expand, self.verboseadd
"""
self.use_expand.sort()
self.use_expand.insert(0, "USE")
-
+
for key in self.use_expand:
if key in self.use_expand_hidden:
continue
@staticmethod
def pkgprint(pkg_str, pkg_info):
"""Colorizes a string acording to pkg_info settings
-
+
@param pkg_str: string
@param pkg_info: dictionary
@rtype colorized string
def verbose_size(self, pkg, repoadd_set, pkg_info):
"""Determines the size of the downloads reqired
-
+
@param pkg: _emerge.Package instance
@param repoadd_set: set of repos to add
@param pkg_info: dictionary
@staticmethod
def convert_myoldbest(myoldbest):
"""converts and colorizes a version list to a string
-
+
@param myoldbest: list
@rtype string.
"""
- # Convert myoldbest from a list to a string.
+ # Convert myoldbest from a list to a string.
myoldbest_str = ""
if myoldbest:
versions = []
def _set_non_root_columns(self, addl, pkg_info, pkg):
"""sets the indent level and formats the output
-
+
@param addl: already defined string to add to
@param pkg_info: dictionary
@param pkg: _emerge.Package instance
def _set_root_columns(self, addl, pkg_info, pkg):
"""sets the indent level and formats the output
-
+
@param addl: already defined string to add to
@param pkg_info: dictionary
@param pkg: _emerge.Package instance
def _insert_slot(self, pkg, pkg_info, myinslotlist):
"""Adds slot info to the message
-
+
@returns addl: formatted slot info
@returns myoldbest: installed version list
Modifies self.counters.downgrades, self.counters.upgrades,
def _new_slot(self, pkg, pkg_info):
"""New slot, mark it new.
-
+
@returns addl: formatted slot info
@returns myoldbest: installed version list
Modifies self.counters.newslot, self.counters.binary
def print_messages(self, show_repos):
"""Performs the actual output printing of the pre-formatted
messages
-
+
@param show_repos: bool.
"""
for msg in self.print_msg:
def print_verbose(self, show_repos):
"""Prints the verbose output to std_out
-
+
@param show_repos: bool.
"""
writemsg_stdout('\n%s\n' % (self.counters,), noiselevel=-1)
def get_display_list(self, mylist):
"""Determines the display list to process
-
+
@param mylist
@rtype list
Modifies self.counters.blocks, self.counters.blocks_satisfied,
-
+
"""
unsatisfied_blockers = []
ordered_nodes = []
def set_pkg_info(self, pkg, ordered):
"""Sets various pkg_info dictionary variables
-
+
@param pkg: _emerge.Package instance
@param ordered: bool
@rtype pkg_info dictionary
- Modifies self.counters.restrict_fetch,
+ Modifies self.counters.restrict_fetch,
self.counters.restrict_fetch_satisfied
"""
pkg_info = PkgInfo()
def do_changelog(self, pkg, pkg_info):
"""Processes and adds the changelog text to the master text for output
-
+
@param pkg: _emerge.Package instance
@param pkg_info: dictionay
Modifies self.changelogs
def check_system_world(self, pkg):
"""Checks for any occurances of the package in the system or world sets
-
+
@param pkg: _emerge.Package instance
@rtype system and world booleans
"""
except InvalidDependString:
# This is reported elsewhere if relevant.
pass
- return system, world
+ return system, world
@staticmethod
"empty" param testing because "empty"
param is used for -u, where you still *do* want to see when
something is being upgraded.
-
+
@param pkg: _emerge.Package instance
@param pkg_info: dictionay
@rtype addl, myoldbest: list, myinslotlist: list
Modifies self.counters.reinst, self.counters.binary, self.counters.new
-
+
"""
myoldbest = []
myinslotlist = None
def __call__(self, depgraph, mylist, favorites=None, verbosity=None):
"""The main operation to format and display the resolver output.
-
+
@param depgraph: dependency grah
@param mylist: list of packages being processed
@param favorites: list, defaults to []
@param verbosity: verbose level, defaults to None
Modifies self.conf, self.myfetchlist, self.portdb, self.vardb,
- self.pkgsettings, self.verboseadd, self.oldlp, self.newlp,
- self.print_msg,
+ self.pkgsettings, self.verboseadd, self.oldlp, self.newlp,
+ self.print_msg,
"""
if favorites is None:
favorites = []
self._get_installed_best(pkg, pkg_info)
self.verboseadd = ""
self.repoadd = None
- self._display_keyword(pkg)
+ if self.conf.verbosity == 3:
+ self._display_keyword(pkg)
self._display_use(pkg, pkg_info.oldbest, myinslotlist)
self.recheck_hidden(pkg)
if self.conf.verbosity == 3: