diff options
author | necoro <> | 2007-03-10 22:59:52 +0000 |
---|---|---|
committer | necoro <> | 2007-03-10 22:59:52 +0000 |
commit | 47a7b294e5a889afb932d371021d2b53adc20665 (patch) | |
tree | 4d53351b770b785eee790547d5574561e3c8b847 /portato/gui/gtk/usetips.py | |
parent | 22a0baf7f459b267febfb16c7bc90cf460323a87 (diff) | |
download | portato-47a7b294e5a889afb932d371021d2b53adc20665.tar.gz portato-47a7b294e5a889afb932d371021d2b53adc20665.tar.bz2 portato-47a7b294e5a889afb932d371021d2b53adc20665.zip |
Added USE_EXPAND-support
Diffstat (limited to 'portato/gui/gtk/usetips.py')
-rw-r--r-- | portato/gui/gtk/usetips.py | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/portato/gui/gtk/usetips.py b/portato/gui/gtk/usetips.py index 75bb63f..db970c1 100644 --- a/portato/gui/gtk/usetips.py +++ b/portato/gui/gtk/usetips.py @@ -51,26 +51,35 @@ class UseTips (TreeViewTooltips): pkg = system.new_package(cpv) enabled = [] disabled = [] + expanded = set() pkg_flags = pkg.get_all_use_flags() - if len(pkg_flags) == 0: # no flags - stop here + if not pkg_flags: # no flags - stop here return None pkg_flags.sort() for use in pkg_flags: - if pkg.is_use_flag_enabled(use): - enabled.append(use) + exp = pkg.use_expanded(use) + if exp: + expanded.add(exp) + else: - disabled.append(use) + if pkg.is_use_flag_enabled(use): + enabled.append(use) + else: + disabled.append(use) string = "" - if len(enabled) > 0: + if enabled: string = "<b>+%s</b>" % ("\n+".join(enabled),) if len(disabled) > 0: string = string + "\n" - if len(disabled) > 0: + if disabled: string = string+"<i>- %s</i>" % ("\n- ".join(disabled),) + if expanded: + string = string+"\n\n"+"\n".join(expanded) + return string |