From 35b4b3dd6ef87674c088d7c73d92327407efd076 Mon Sep 17 00:00:00 2001 From: Necoro <> Date: Mon, 5 Nov 2007 13:49:27 +0000 Subject: r528@Devoty: necoro | 2007-11-04 22:11:39 +0100 Select correct versions again r529@Devoty: necoro | 2007-11-05 14:46:07 +0100 Removed 3rd party tooltips for queue list. --- portato/gui/gtk/usetips.py | 101 --------------------------------------------- 1 file changed, 101 deletions(-) delete mode 100644 portato/gui/gtk/usetips.py (limited to 'portato/gui/gtk/usetips.py') diff --git a/portato/gui/gtk/usetips.py b/portato/gui/gtk/usetips.py deleted file mode 100644 index 69e9f9a..0000000 --- a/portato/gui/gtk/usetips.py +++ /dev/null @@ -1,101 +0,0 @@ -# -*- coding: utf-8 -*- -# -# File: portato/gui/gtk/usetips.py -# This file is part of the Portato-Project, a graphical portage-frontend. -# -# Copyright (C) 2007 René 'Necoro' Neumann -# This is free software. You may redistribute copies of it under the terms of -# the GNU General Public License version 2. -# There is NO WARRANTY, to the extent permitted by law. -# -# Written by René 'Necoro' Neumann - -from __future__ import absolute_import - -from ...backend import system -from ...backend.flags import invert_use_flag - -from .TreeViewTooltips import TreeViewTooltips - -class UseTips (TreeViewTooltips): - """This class handles the display of the so called use-tips, - i.e. the tooltips showing the actual use-flags.""" - - def __init__ (self, colno, cfg = None): - """Constructor. - - @param colno: the number of the column to check - @type colno: int - @param cfg: a config to look in, whether we should show the tips or not - @type cfg: Config""" - - self.colno = colno - self.cfg = cfg - - TreeViewTooltips.__init__(self) - - def get_tooltip(self, view, column, path): - - # check config - if self.cfg is not None: - if not self.cfg.get_boolean("useTips", "GTK"): - return None - - store = view.get_model() - it = store.get_iter(path) - - if store.iter_parent(it) is not None: - return self.__get_flags(store.get_value(it, self.colno)) - else: # top items - ignore them - return None - - def __get_flags(self, cpv): - pkg = system.new_package(cpv) - enabled = [] - disabled = [] - expanded = set() - - pkg_flags = pkg.get_iuse_flags() - if not pkg_flags: # no flags - stop here - return None - - pkg_flags.sort() - actual = pkg.get_actual_use_flags() - - if pkg.is_installed(): - installed = pkg.get_installed_use_flags() - else: - inst = system.find_installed_packages(pkg.get_slot_cp()) - if inst: - installed = inst[0].get_installed_use_flags() - else: - installed = [] - - for use in pkg_flags: - exp = pkg.use_expanded(use) - if exp: - expanded.add(exp) - - else: - useStr = use - if installed and ((use in actual) != (use in installed)): - useStr += " %" - if use in actual: - enabled.append(useStr) - else: - disabled.append(useStr) - - string = "" - - if enabled: - string = "+%s" % ("\n+".join(enabled),) - if len(disabled) > 0: - string = string + "\n" - - if disabled: - string = string+"- %s" % ("\n- ".join(disabled),) - - if expanded: - string = string+"\n\n"+"\n".join(expanded) - - return string -- cgit v1.2.3-70-g09d2