diff options
Diffstat (limited to '')
-rw-r--r-- | portato/gui/dialogs.py | 9 | ||||
-rw-r--r-- | portato/gui/exception_handling.py | 17 | ||||
-rw-r--r-- | portato/gui/exceptions.py | 2 | ||||
-rw-r--r-- | portato/gui/queue.py | 19 | ||||
-rw-r--r-- | portato/gui/session.py | 2 | ||||
-rw-r--r-- | portato/gui/updater.py | 2 | ||||
-rw-r--r-- | portato/gui/utils.py | 2 | ||||
-rw-r--r-- | portato/gui/views.py | 5 | ||||
-rw-r--r-- | portato/gui/windows/__init__.py | 2 | ||||
-rw-r--r-- | portato/gui/windows/about.py | 2 | ||||
-rw-r--r-- | portato/gui/windows/basic.py | 5 | ||||
-rw-r--r-- | portato/gui/windows/mailinfo.py | 2 | ||||
-rw-r--r-- | portato/gui/windows/main.py | 150 | ||||
-rw-r--r-- | portato/gui/windows/plugin.py | 2 | ||||
-rw-r--r-- | portato/gui/windows/preference.py | 2 | ||||
-rw-r--r-- | portato/gui/windows/search.py | 2 | ||||
-rw-r--r-- | portato/gui/windows/splash.py | 2 | ||||
-rw-r--r-- | portato/gui/windows/update.py | 2 | ||||
-rw-r--r-- | portato/gui/wrapper.py | 2 |
19 files changed, 116 insertions, 115 deletions
diff --git a/portato/gui/dialogs.py b/portato/gui/dialogs.py index 8931535..d7ac41b 100644 --- a/portato/gui/dialogs.py +++ b/portato/gui/dialogs.py @@ -11,7 +11,7 @@ # Written by René 'Necoro' Neumann <necoro@necoro.net> import gtk -from ..helper import error +from ..helper import error, get_runsystem def mail_failure_dialog(e): dialog = gtk.MessageDialog(None, gtk.DIALOG_MODAL, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, _("Mail could not be sent")) @@ -109,7 +109,12 @@ def file_chooser_dialog (title, parent): def prereq_error_dialog (e): dialog = gtk.MessageDialog(None, gtk.DIALOG_MODAL, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, _("A prerequisite for starting Portato was not matched.")) - dialog.format_secondary_text(e.message) + + msg = e.message + if get_runsystem()[0] == "Sabayon": + msg += "\n\n"+_("<b>Note</b>: On fresh Sabayon installs or its LiveDVD/-CD, there is no portage tree existing per default.\nPlease run <i>emerge --sync && layman -S</i>.") + + dialog.format_secondary_markup(msg) ret = dialog.run() dialog.destroy() return ret diff --git a/portato/gui/exception_handling.py b/portato/gui/exception_handling.py index a5174f5..2e9c76c 100644 --- a/portato/gui/exception_handling.py +++ b/portato/gui/exception_handling.py @@ -3,7 +3,7 @@ # File: portato/gui/exception_handling.py # This file is part of the Portato-Project, a graphical portage-frontend. # -# Copyright (C) 2007-2009 René 'Necoro' Neumann +# Copyright (C) 2006-2009 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. @@ -18,7 +18,7 @@ import sys, traceback, os from StringIO import StringIO -from ..helper import debug, error +from ..helper import debug, error, get_runsystem from .dialogs import file_chooser_dialog, io_ex_dialog from .windows.mailinfo import MailInfoWindow from .utils import GtkThread @@ -101,20 +101,9 @@ def get_version_infos(): from ..constants import VERSION from ..backend import system - runsystem="Unknown" - if os.path.exists("/etc/gentoo-release"): - runsystem = "Gentoo" - else: - for sp in ("/etc/sabayon-release", "/etc/sabayon-edition"): - if os.path.exists(sp): - with open(sp) as r: - runsystem = "Sabayon: %s" % r.readline().strip() - break - - return "\n".join(( "Portato version: %s" % VERSION, - "System: %s" % runsystem, + "System: %s" % " ".join(get_runsystem()), "Python version: %s" % sys.version, "Used backend: %s" % system.get_version(), "pygtk: %s (using GTK+: %s)" % (convert(gtk.pygtk_version), convert(gtk.gtk_version)), diff --git a/portato/gui/exceptions.py b/portato/gui/exceptions.py index 11bc83d..17041dc 100644 --- a/portato/gui/exceptions.py +++ b/portato/gui/exceptions.py @@ -3,7 +3,7 @@ # File: portato/gui/exceptions.py # This file is part of the Portato-Project, a graphical portage-frontend. # -# Copyright (C) 2009 René 'Necoro' Neumann +# Copyright (C) 2006-2009 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. diff --git a/portato/gui/queue.py b/portato/gui/queue.py index 5a414a2..d7b1e3f 100644 --- a/portato/gui/queue.py +++ b/portato/gui/queue.py @@ -3,7 +3,7 @@ # File: portato/gui/queue.py # This file is part of the Portato-Project, a graphical portage-frontend. # -# Copyright (C) 2008 René 'Necoro' Neumann +# Copyright (C) 2006-2009 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. @@ -22,7 +22,7 @@ from subprocess import Popen from .. import backend, plugin from ..backend import flags, system from ..backend.exceptions import BlockedException -from ..helper import debug, info, warning, send_signal_to_group, unique_array, flatten +from ..helper import debug, info, warning, error, send_signal_to_group, unique_array, flatten from ..waiting_queue import WaitingQueue from ..odict import OrderedDict from .updater import Updater @@ -191,14 +191,14 @@ class EmergeQueue: self.remove(top) raise - # add iter - subIt = self.tree.append(it, self.tree.build_append_value(cpv, oneshot = oneshot, update = update, downgrade = downgrade, version = uVersion, useChange = changedUse)) - self.iters[type][cpv] = subIt - # get dependencies deps = pkg.get_dep_packages(return_blocks = True) self.deps[type][cpv] = deps + # add iter + subIt = self.tree.append(it, self.tree.build_append_value(cpv, oneshot = oneshot, update = update, downgrade = downgrade, version = uVersion, useChange = changedUse)) + self.iters[type][cpv] = subIt + for d in deps: if d[0] == "!": # block dep = d[1:] @@ -300,9 +300,10 @@ class EmergeQueue: raise BlockedException(blocked, pkgs[0].get_cpv()) else: # unmerge - self.unmergequeue.append(cpv) - if self.tree: # update tree - self.iters["uninstall"][cpv] = self.tree.append(self.tree.get_unmerge_it(), self.tree.build_append_value(cpv)) + if cpv not in self.unmergequeue: + self.unmergequeue.append(cpv) + if self.tree: # update tree + self.iters["uninstall"][cpv] = self.tree.append(self.tree.get_unmerge_it(), self.tree.build_append_value(cpv)) def _queue_append (self, cpv, oneshot = False): """Convenience function appending a cpv either to self.mergequeue or to self.oneshotmerge. diff --git a/portato/gui/session.py b/portato/gui/session.py index 40a84f1..7aa890d 100644 --- a/portato/gui/session.py +++ b/portato/gui/session.py @@ -3,7 +3,7 @@ # File: portato/gui/session.py # This file is part of the Portato-Project, a graphical portage-frontend. # -# Copyright (C) 2008 René 'Necoro' Neumann +# Copyright (C) 2006-2009 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. diff --git a/portato/gui/updater.py b/portato/gui/updater.py index c4ad2a5..7ce7c51 100644 --- a/portato/gui/updater.py +++ b/portato/gui/updater.py @@ -3,7 +3,7 @@ # File: portato/gui/updater.py # This file is part of the Portato-Project, a graphical portage-frontend. # -# Copyright (C) 2008 René 'Necoro' Neumann +# Copyright (C) 2006-2009 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. diff --git a/portato/gui/utils.py b/portato/gui/utils.py index c9eae69..1ebefe8 100644 --- a/portato/gui/utils.py +++ b/portato/gui/utils.py @@ -3,7 +3,7 @@ # File: portato/gui/utils.py # This file is part of the Portato-Project, a graphical portage-frontend. # -# Copyright (C) 2006-2008 René 'Necoro' Neumann +# Copyright (C) 2006-2009 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. diff --git a/portato/gui/views.py b/portato/gui/views.py index 26a8a89..3fc965f 100644 --- a/portato/gui/views.py +++ b/portato/gui/views.py @@ -3,7 +3,7 @@ # File: portato/gui/views.py # This file is part of the Portato-Project, a graphical portage-frontend. # -# Copyright (C) 2006-2008 René 'Necoro' Neumann +# Copyright (C) 2006-2009 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. @@ -18,6 +18,7 @@ import gtksourceview2 import logging from ..helper import warning +from ..log import add_handler class LazyView (object): def __init__ (self): @@ -147,7 +148,7 @@ class LogView (logging.Handler): for lvl, name, color in self.colors: self.buf.create_tag("log_%s" % name, foreground = color,weight = pango.WEIGHT_BOLD) - logging.getLogger("portatoLogger.stream").addHandler(self) + add_handler(self) def emit (self, record): diff --git a/portato/gui/windows/__init__.py b/portato/gui/windows/__init__.py index 394e84e..6a4ac82 100644 --- a/portato/gui/windows/__init__.py +++ b/portato/gui/windows/__init__.py @@ -3,7 +3,7 @@ # File: portato/gui/gtk/__init__.py # This file is part of the Portato-Project, a graphical portage-frontend. # -# Copyright (C) 2008 René 'Necoro' Neumann +# Copyright (C) 2006-2009 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. diff --git a/portato/gui/windows/about.py b/portato/gui/windows/about.py index 21608c0..937ed8b 100644 --- a/portato/gui/windows/about.py +++ b/portato/gui/windows/about.py @@ -3,7 +3,7 @@ # File: portato/gui/windows/about.py # This file is part of the Portato-Project, a graphical portage-frontend. # -# Copyright (C) 2008 René 'Necoro' Neumann +# Copyright (C) 2006-2009 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. diff --git a/portato/gui/windows/basic.py b/portato/gui/windows/basic.py index 635083a..1117e5e 100644 --- a/portato/gui/windows/basic.py +++ b/portato/gui/windows/basic.py @@ -3,7 +3,7 @@ # File: portato/gui/windows/basic.py # This file is part of the Portato-Project, a graphical portage-frontend. # -# Copyright (C) 2006-2008 René 'Necoro' Neumann +# Copyright (C) 2006-2009 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. @@ -20,7 +20,7 @@ import gobject from functools import wraps import os.path -from ...constants import TEMPLATE_DIR, APP_ICON, APP, LOCALE_DIR +from ...constants import TEMPLATE_DIR, APP, LOCALE_DIR from ...helper import error gtk.glade.bindtextdomain (APP, LOCALE_DIR) @@ -59,7 +59,6 @@ class Window (object): self.tree = self.get_tree(self.__tree__) self.tree.signal_autoconnect(self) self.window = self.tree.get_widget(self.__window__) - self.window.set_icon_from_file(APP_ICON) @staticmethod def watch_cursor (func): diff --git a/portato/gui/windows/mailinfo.py b/portato/gui/windows/mailinfo.py index bbcbf1f..0cc79f2 100644 --- a/portato/gui/windows/mailinfo.py +++ b/portato/gui/windows/mailinfo.py @@ -3,7 +3,7 @@ # File: portato/gui/windows/mailinfo.py # This file is part of the Portato-Project, a graphical portage-frontend. # -# Copyright (C) 2008 René 'Necoro' Neumann +# Copyright (C) 2006-2009 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. diff --git a/portato/gui/windows/main.py b/portato/gui/windows/main.py index 9f3c123..8d5e5ae 100644 --- a/portato/gui/windows/main.py +++ b/portato/gui/windows/main.py @@ -164,7 +164,7 @@ class PackageTable: self.linkBox.remove(c) text = pkg.get_package_settings("HOMEPAGE") - texts = text.split(" ") + texts = text.split() ftexts = [] for count, t in enumerate(texts): @@ -440,6 +440,10 @@ class MainWindow (Window): self.window.set_title(self.main_title) self.window.set_geometry_hints (self.window, max_height = gtk.gdk.screen_height(), max_width = gtk.gdk.screen_width()) + # app icon + self.window.set_icon_from_file(APP_ICON) + gtk.window_set_default_icon(self.window.get_icon()) + # booleans self.doUpdate = False self.showAll = True # show only installed or all packages? @@ -1049,73 +1053,19 @@ class MainWindow (Window): # SELECTION def load_pkg_selection (name): pos = "0" - col = 1 - model = self.pkgList.get_model() - - if name: - if oldVersion > 1: # newer one - name, pos = name.split("@") - - if model[pos][col] != name: # need to search :( - debug("Pkg path does not match. Searching...") - for cname, path in ((x[col], x.path) for x in model): - if cname == name: - pos = path - break + if name and oldVersion > 1: # newer one + name, pos = name.split("@") - debug("Selecting pkg path '%s'. Value: '%s'", pos, model[pos][col]) - self.pkgList.get_selection().select_path(pos) - self.pkgList.scroll_to_cell(pos) + self.jump_to_pkg(name, pos) def load_cat_selection (name): pos = "0" - col = 0 - model = self.catList.get_model() - - if name: - if oldVersion > 1: # newer one - name, pos = name.split("@") - - if self.cfg.get_boolean("collapseCats", "GUI"): - try: - sname = name.split("-", 1) - except ValueError: # nothing to split - sname = None - else: - sname = None - - if sname is None and model[pos][col] != name: # need to search in normal list - debug("Cat path does not match. Searching...") - for cname, path in ((x[col], x.path) for x in model): - if cname == name: - pos = path - break - - elif sname: # the collapse case - row = model[pos.split(":")[0]] - no_match = False - if row[col] != sname[0]: # first part does not match :( - debug("First part of cat path does not match. Searching...") - no_match = True - for r in model: - if r[col] == sname[0]: - row = r - break - - if no_match or model[pos][col] != sname[1]: - debug("Second part of cat path does not match. Searching...") - for cname, path in ((x[col], x.path) for x in row.iterchildren()): - if cname == sname[1]: # found second - pos = ":".join(map(str,path)) - break - - self.catList.expand_to_path(pos) + if name and oldVersion > 1: # newer one + name, pos = name.split("@") - debug("Selecting cat path '%s'. Value: '%s'", pos, model[pos][col]) - self.catList.get_selection().select_path(pos) - self.catList.scroll_to_cell(pos) + self.jump_to_cat(name, pos) def save_pkg_selection (): store, iter = self.pkgList.get_selection().get_selected() @@ -1235,17 +1185,76 @@ class MainWindow (Window): cat, pkg = cp.split("/") - for list, idx, what, expr in ((self.catList, 0, "categories", cat), (self.pkgList, 1, "packages", pkg)): - pathes = [row.path for row in list.get_model() if row[idx] == expr] + self.jump_to_cat(cat) + self.jump_to_pkg(pkg) + + self.show_package(cp = cp, version = version, queue = self.queue) + + def jump_to_pkg (self, name = None, pos = "0"): + if isinstance(pos, int): + pos = str(pos) + + col = 1 + model = self.pkgList.get_model() + + if name: + if model[pos][col] != name: # need to search :( + debug("Pkg path does not match. Searching...") + for cname, path in ((x[col], x.path) for x in model): + if cname == name: + pos = path + break + + debug("Selecting pkg path '%s'. Value: '%s'", pos, model[pos][col]) + self.pkgList.get_selection().select_path(pos) + self.pkgList.scroll_to_cell(pos) - if len(pathes) == 1: - list.get_selection().select_path(pathes[0]) - list.scroll_to_cell(pathes[0]) + def jump_to_cat (self, name = None, pos = "0"): + if isinstance(pos, int): + pos = str(pos) + + col = 0 + model = self.catList.get_model() + + if name: + if self.cfg.get_boolean("collapseCats", "GUI"): + try: + sname = name.split("-", 1) + except ValueError: # nothing to split + sname = None else: - debug("Unexpected number of %s returned after search: %d", what, len(pathes)) - break + sname = None + + if sname is None and model[pos][col] != name: # need to search in normal list + debug("Cat path does not match. Searching...") + for cname, path in ((x[col], x.path) for x in model): + if cname == name: + pos = path + break + + elif sname: # the collapse case + row = model[pos.split(":")[0]] + no_match = False + if row[col] != sname[0]: # first part does not match :( + debug("First part of cat path does not match. Searching...") + no_match = True + for r in model: + if r[col] == sname[0]: + row = r + break - self.show_package(cp = cp, version = version, queue = self.queue) + if no_match or model[pos][col] != sname[1]: + debug("Second part of cat path does not match. Searching...") + for cname, path in ((x[col], x.path) for x in row.iterchildren()): + if cname == sname[1]: # found second + pos = ":".join(map(str,path)) + break + + self.catList.expand_to_path(pos) + + debug("Selecting cat path '%s'. Value: '%s'", pos, model[pos][col]) + self.catList.get_selection().select_path(pos) + self.catList.scroll_to_cell(pos) def set_uri_hook (self, browser): """ @@ -1624,9 +1633,6 @@ class MainWindow (Window): """Do a search.""" text = entry.get_text() if text != "": - if "/" not in text: - text = "/.*"+text # only look for package names - packages = system.find_packages(text, with_version = False) if packages == []: diff --git a/portato/gui/windows/plugin.py b/portato/gui/windows/plugin.py index eccf302..755ad58 100644 --- a/portato/gui/windows/plugin.py +++ b/portato/gui/windows/plugin.py @@ -3,7 +3,7 @@ # File: portato/gui/windows/plugin.py # This file is part of the Portato-Project, a graphical portage-frontend. # -# Copyright (C) 2008 René 'Necoro' Neumann +# Copyright (C) 2006-2009 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. diff --git a/portato/gui/windows/preference.py b/portato/gui/windows/preference.py index 87a1860..df18e88 100644 --- a/portato/gui/windows/preference.py +++ b/portato/gui/windows/preference.py @@ -3,7 +3,7 @@ # File: portato/gui/windows/preference.py # This file is part of the Portato-Project, a graphical portage-frontend. # -# Copyright (C) 2008 René 'Necoro' Neumann +# Copyright (C) 2006-2009 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. diff --git a/portato/gui/windows/search.py b/portato/gui/windows/search.py index 415cbfe..c531507 100644 --- a/portato/gui/windows/search.py +++ b/portato/gui/windows/search.py @@ -3,7 +3,7 @@ # File: portato/gui/windows/search.py # This file is part of the Portato-Project, a graphical portage-frontend. # -# Copyright (C) 2008 René 'Necoro' Neumann +# Copyright (C) 2006-2009 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. diff --git a/portato/gui/windows/splash.py b/portato/gui/windows/splash.py index c27f74f..39ba00d 100644 --- a/portato/gui/windows/splash.py +++ b/portato/gui/windows/splash.py @@ -3,7 +3,7 @@ # File: portato/gui/windows/splash.py # This file is part of the Portato-Project, a graphical portage-frontend. # -# Copyright (C) 2007-2008 René 'Necoro' Neumann +# Copyright (C) 2006-2009 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. diff --git a/portato/gui/windows/update.py b/portato/gui/windows/update.py index 297f666..8e32dd9 100644 --- a/portato/gui/windows/update.py +++ b/portato/gui/windows/update.py @@ -3,7 +3,7 @@ # File: portato/gui/windows/update.py # This file is part of the Portato-Project, a graphical portage-frontend. # -# Copyright (C) 2008 René 'Necoro' Neumann +# Copyright (C) 2006-2009 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. diff --git a/portato/gui/wrapper.py b/portato/gui/wrapper.py index a160e2f..525ad12 100644 --- a/portato/gui/wrapper.py +++ b/portato/gui/wrapper.py @@ -3,7 +3,7 @@ # File: portato/gui/wrapper.py # This file is part of the Portato-Project, a graphical portage-frontend. # -# Copyright (C) 2006-2008 René 'Necoro' Neumann +# Copyright (C) 2006-2009 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. |