summaryrefslogtreecommitdiff
path: root/portato
diff options
context:
space:
mode:
Diffstat (limited to 'portato')
-rw-r--r--portato/backend/__init__.py11
-rw-r--r--portato/backend/catapult/__init__.py19
-rw-r--r--portato/backend/catapult/package.py156
-rw-r--r--portato/backend/catapult/system.py252
-rw-r--r--portato/backend/portage/system.py32
-rw-r--r--portato/config_parser.py24
-rw-r--r--portato/constants.py7
-rw-r--r--portato/gui/dialogs.py14
-rw-r--r--portato/gui/exception_handling.py5
-rw-r--r--portato/gui/queue.py2
-rw-r--r--portato/gui/templates/PluginWindow.glade180
-rw-r--r--portato/gui/utils.py10
-rw-r--r--portato/gui/windows/main.py22
-rw-r--r--portato/gui/windows/plugin.py162
-rw-r--r--portato/plugin.py825
-rw-r--r--portato/plugins/__init__.py7
-rw-r--r--portato/plugins/etc_proposals.py31
-rw-r--r--portato/plugins/exception.py2
-rw-r--r--portato/plugins/gpytage.py16
-rw-r--r--portato/plugins/new_version.py58
-rw-r--r--portato/plugins/notify.py22
21 files changed, 795 insertions, 1062 deletions
diff --git a/portato/backend/__init__.py b/portato/backend/__init__.py
index 003feb7..b2a5a43 100644
--- a/portato/backend/__init__.py
+++ b/portato/backend/__init__.py
@@ -13,14 +13,10 @@
from __future__ import absolute_import
from ..helper import debug
-from ..constants import USE_CATAPULT
from .system_interface import SystemInterface
from .exceptions import BlockedException, PackageNotFoundException, DependencyCalcError, InvalidSystemError
-if USE_CATAPULT:
- SYSTEM = "catapult"
-else:
- SYSTEM = "portage" # the name of the current system
+SYSTEM = "portage" # the name of the current system
_sys = None # the SystemInterface-instance
class _Package (object):
@@ -45,8 +41,9 @@ def set_system (new_sys):
@type new_sys: string"""
global SYSTEM
- SYSTEM = new_sys
- load_system()
+ if new_sys != SYSTEM:
+ SYSTEM = new_sys
+ load_system()
def load_system ():
"""Loads the current chosen system.
diff --git a/portato/backend/catapult/__init__.py b/portato/backend/catapult/__init__.py
deleted file mode 100644
index 348b941..0000000
--- a/portato/backend/catapult/__init__.py
+++ /dev/null
@@ -1,19 +0,0 @@
-# -*- coding: utf-8 -*-
-#
-# File: portato/backend/catapult/__init__.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 <necoro@necoro.net>
-
-from __future__ import absolute_import
-
-from dbus.mainloop.glib import DBusGMainLoop
-DBusGMainLoop(set_as_default=True)
-
-from .system import CatapultSystem
-from .package import CatapultPackage
diff --git a/portato/backend/catapult/package.py b/portato/backend/catapult/package.py
deleted file mode 100644
index 2e4f471..0000000
--- a/portato/backend/catapult/package.py
+++ /dev/null
@@ -1,156 +0,0 @@
-# -*- coding: utf-8 -*-
-#
-# File: portato/backend/catapult/package.py
-# This file is part of the Portato-Project, a graphical portage-frontend.
-#
-# Copyright (C) 2007-2008 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 <necoro@necoro.net>
-
-from __future__ import absolute_import, with_statement
-
-from ..package import Package
-from .. import flags
-from .. import system
-from ..exceptions import BlockedException, PackageNotFoundException
-from ...helper import debug, unique_array
-
-import dbus
-import catapult
-
-import os.path
-
-class CatapultPackage(Package):
-
- bus = dbus.SessionBus()
- dbus_object = bus.get_object(catapult.get_dbus_address(catapult.DEFAULT), catapult.CATAPULT_PACKAGE_BUS, follow_name_owner_changes = True)
- proxy = dbus.Interface(dbus_object, catapult.CATAPULT_PACKAGE_IFACE)
-
- _expand = {}
-
- def _new_flags (self):
- flags = self.get_new_use_flags()
-
- nflags = []
-
- for flag in flags:
- if flag[0] == "~":
- nflags.append((flag[1:], True))
- else:
- nflags.append((flag, False))
-
- return nflags
-
- def use_expanded (self, flag, suggest = None):
-
- exp = self._expand.get(flag, False)
-
- if exp is False:
- if not suggest:
- suggest = ""
- s = str(self.proxy.use_expanded(self.get_cpv(), flag, suggest))
- if not s:
- s = None
-
- self._expand[flag] = s
- return s
- else:
- return exp
-
- def get_package_path(self):
- return str(self.proxy.get_package_path(self.get_cpv()))
-
- def is_installed(self):
- return self.proxy.is_installed(self.get_cpv())
-
- def is_overlay(self):
- return self.proxy.is_in_overlay(self.get_cpv())
-
- def get_overlay_path(self):
- return str(self.proxy.get_overlay_path(self.get_cpv()))
-
- def is_in_system (self):
- return self.proxy.is_in_system(self.get_cpv())
-
- def is_missing_keyword(self):
- return self.proxy.is_missing_keyword(self.get_cpv())
-
- def is_testing(self, use_keywords = False):
- if not use_keywords:
- return self.proxy.is_testing(self.get_cpv(), False)
- else:
- status = flags.new_testing_status(self.get_cpv())
- if status is None:
- return self.proxy.is_testing(self.get_cpv(), True)
- else:
- return status
-
- def is_masked (self, use_changed = True):
- if use_changed:
- status = flags.new_masking_status(self.get_cpv())
- if status != None: # we have locally changed it
- if status == "masked": return True
- elif status == "unmasked": return False
- else:
- error(_("BUG in flags.new_masking_status. It returns \'%s\'"), status)
- else: # we have not touched the status
- return self.proxy.is_masked(self.get_cpv())
- else: # we want the original portage value XXX: bug if masked by user AND by system
- if self.proxy.is_masked(self.get_cpv()):
- if not flags.is_locally_masked(self, changes = False): # assume that if it is locally masked, it is not masked by the system
- return True
-
- return False
-
- def get_masking_reason (self):
- return str(self.proxy.get_masking_reason(self.get_cpv()))
-
- def get_iuse_flags (self, installed = False, removeForced = True):
- return [str(x) for x in self.proxy.get_iuse_flags(self.get_cpv(), installed, removeForced)]
-
- def get_matched_dep_packages (self, depvar):
- return [str(x) for x in self.proxy.get_matched_dep_packages(self.get_cpv(), self._new_flags())]
-
- def get_dep_packages (self, depvar = ["RDEPEND", "PDEPEND", "DEPEND"], with_criterions = False):
- pkgs = self.proxy.get_dep_packages(self.get_cpv(), depvar, self._new_flags())
-
- if not with_criterions:
- return [str(x) for x,y in pkgs]
- else:
- return [(str(x),str(y)) for x,y in pkgs]
-
- def get_global_settings(self, key, installed = True):
- return str(self.proxy.get_global_settings(self.get_cpv(), key, installed))
-
- def get_ebuild_path(self):
- return str(self.proxy.get_ebuild_path(self.get_cpv()))
-
- def get_package_settings(self, var, tree = True):
- return str(self.proxy.get_package_settings(self.get_cpv(), var, tree))
-
- def get_installed_use_flags(self):
- return self.proxy.get_installed_use_flags(self.get_cpv())
-
- def get_actual_use_flags(self):
- return self.proxy.get_actual_use_flags(self.get_cpv(), self._new_flags())
-
- def compare_version(self, other):
- return self.proxy.compare_version(self.get_cpv(), other.get_cpv())
-
- def matches (self, criterion):
- return self.proxy.matches(self.get_cpv(), criterion)
-
- def get_files (self):
- return self.proxy.get_files(self.get_cpv())
-
- def get_name(self):
- return str(self.proxy.get_name(self.get_cpv()))
-
- def get_version(self):
- return str(self.proxy.get_version(self.get_cpv()))
-
- def get_category(self):
- return str(self.proxy.get_category(self.get_cpv()))
diff --git a/portato/backend/catapult/system.py b/portato/backend/catapult/system.py
deleted file mode 100644
index 3a3bac5..0000000
--- a/portato/backend/catapult/system.py
+++ /dev/null
@@ -1,252 +0,0 @@
-# -*- coding: utf-8 -*-
-#
-# File: portato/backend/catapult/system.py
-# This file is part of the Portato-Project, a graphical portage-frontend.
-#
-# Copyright (C) 2007-2008 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 <necoro@necoro.net>
-
-from __future__ import absolute_import
-
-import re, os
-from threading import Event
-import dbus
-import catapult
-
-from .package import CatapultPackage
-from ..system_interface import SystemInterface
-from ...helper import debug, info, warning, unique_array
-
-class CatapultSystem (SystemInterface):
-
- def __init__ (self):
- SystemInterface.__init__(self)
-
- self.bus = dbus.SessionBus()
- # get the system
- so = self.bus.get_object(catapult.get_dbus_address(catapult.DEFAULT), catapult.CATAPULT_SYSTEM_BUS, follow_name_owner_changes = True)
- self.proxy = dbus.Interface(so, catapult.CATAPULT_SYSTEM_IFACE)
-
- def get_version (self):
- admint = dbus.Interface(self.bus.get_object(catapult.get_dbus_address(catapult.DEFAULT), catapult.CATAPULT_BUS), catapult.CATAPULT_ADMIN_IFACE)
- return "Catapult: %s v. %s" % (self.proxy.bus_name.split(".")[-1], str(admint.version()))
-
- def geneticize_list (self, list_of_packages, only_cpv = False):
- """Convertes a list of cpv's into L{backend.Package}s.
-
- @param list_of_packages: the list of packages
- @type list_of_packages: string[]
- @param only_cpv: do nothing - return the passed list
- @type only_cpv: boolean
- @returns: converted list
- @rtype: PortagePackage[]
- """
-
- if not only_cpv:
- return [CatapultPackage(x) for x in list_of_packages]
- else:
- return [str(x) for x in list_of_packages]
-
-
- def split_cpv (self, cpv):
- split = self.proxy.split_cpv(cpv)
- if all(split):
- return map(str, split)
- else:
- return None
-
- def cpv_matches (self, cpv, criterion):
- return CatapultPackage(cpv).matches(criterion)
-
- def find_best(self, list, only_cpv = False):
- if only_cpv:
- return str(self.proxy.find_best(list))
- else:
- return CatapultPackage(self.proxy.find_best(list))
-
- def find_best_match (self, search_key, masked = False, only_installed = False, only_cpv = False):
- p = self.proxy.find_best_match(search_key, masked, only_installed)
-
- if p :
- if not only_cpv:
- return CatapultPackage(p)
- else:
- return str(p)
- return None
-
- def _wrap_find(self, key, masked, set, withVersion, only_cpv):
-
- l = []
- try:
- l = self.proxy.find_packages(key, set, masked, withVersion)
- except dbus.DBusException, e:
- name, data = str(e).split("\n")[-2].split(": ")[1:]
-
- if name == catapult.CATAPULT_ERR_AMBIGUOUS_PACKAGE:
- debug("Ambigous packages: %s.", data)
- l = []
- for cp in data.split(","):
- l += self.proxy.find_packages(cp, set, masked, withVersion)
- else:
- raise
-
- return self.geneticize_list(l, not(withVersion) or only_cpv)
-
- def find_packages (self, search_key, masked = False, only_cpv = False):
- return self._wrap_find(search_key, masked, "all", True, only_cpv)
-
- def find_installed_packages (self, search_key, masked = False, only_cpv = False):
- return self._wrap_find(search_key, masked, "installed", True, only_cpv)
-
- def find_system_packages (self, only_cpv = False):
-# result = self.proxy.find_system_packages()
-# if only_cpv:
-# return result
-# else:
-# return tuple(map(self.geneticize_list, result))
- return (self._wrap_find(search_key, False, "system", True, only_cpv), [])
-
- def find_world_packages (self, only_cpv = False):
-# result = self.proxy.find_world_packages()
-# if only_cpv:
-# return result
-# else:
-# return tuple(map(self.geneticize_list, result))
- return (self._wrap_find(search_key, False, "world", True, only_cpv), [])
-
- def _wrap_find_all (self, key, masked, set, withVersion, only_cpv):
- if not key:
- key = ""
- else:
- key = "*%s*" % key
-
- l = self.proxy.find_packages("", set, masked, withVersion)
-
- if key:
- l = catapult.filter_list(key, l)
-
- return self.geneticize_list(l, not(withVersion) or only_cpv)
-
- def find_all_installed_packages (self, name = None, withVersion = True, only_cpv = False):
- return self._wrap_find_all(name, True, "installed", withVersion, only_cpv)
-
- def find_all_uninstalled_packages (self, name = None, only_cpv = False):
- return self._wrap_find_all(name, True, "uninstalled", True, only_cpv)
-
- def find_all_packages (self, name = None, withVersion = True, only_cpv = False):
- return self._wrap_find_all(name, True, "all", withVersion, only_cpv)
-
- def find_all_world_packages (self, name = None, only_cpv = False):
- return self._wrap_find_all(name, True, "world", withVersion, only_cpv)
-
- def find_all_system_packages (self, name = None, only_cpv = False):
- return self._wrap_find_all(name, True, "system", withVersion, only_cpv)
-
- def list_categories (self, name = None):
- cats = self.proxy.list_categories()
- if name:
- cats = catapult.filter_list("*%s*" % name, cats)
-
- return map(str, cats)
-
- def sort_package_list(self, pkglist):
- return self.geneticize_list(self.proxy.sort_package_list([x.get_cpv() for x in pkglist]))
-
- def reload_settings (self):
- return self.proxy.reload_settings()
-
- def update_world (self, newuse = False, deep = False):
-
- ret = []
- e = Event()
-
- def wait (list):
- ret.extend([(CatapultPackage(x), CatapultPackage(y)) for x,y in list])
- e.set()
-
- def error (ex):
- e.set()
- raise ex
-
- self.proxy.update_world(newuse, deep, {}, reply_handler = wait, error_handler = error, timeout = 300)
- e.wait()
- return ret
- # return [(CatapultPackage(x), CatapultPackage(y)) for x,y in self.proxy.update_world(newuse, deep, {}, timeout = 300)]
-
- def get_updated_packages (self):
- ret = []
- e = Event()
-
- def wait (list):
- ret.extend([CatapultPackage(x) for x in list])
- e.set()
-
- def error (ex):
- e.set()
- raise ex
-
- self.proxy.get_updated_packages(reply_handler = wait, error_handler = error, timeout = 300)
- e.wait()
- return ret
-
- def get_use_desc (self, flag, package = None):
- if not package:
- package = ""
- return str(self.proxy.get_use_desc(flag, package))
-
- def get_global_settings(self, key):
- return str(self.proxy.get_global_settings(key))
-
- def new_package (self, cpv):
- return CatapultPackage(cpv)
-
- def get_config_path (self):
- return str(self.proxy.get_config_path())
-
- def get_sync_command (self):
- return [str(x) for x in self.proxy.get_sync_command()]
-
- def get_merge_command (self):
- return [str(x) for x in self.proxy.get_merge_command()]
-
- def get_oneshot_option (self):
- return [str(x) for x in self.proxy.get_oneshot_option()]
-
- def get_newuse_option (self):
- return [str(x) for x in self.proxy.get_newuse_option()]
-
- def get_deep_option (self):
- return [str(x) for x in self.proxy.get_deep_option()]
-
- def get_update_option (self):
- return [str(x) for x in self.proxy.get_update_option()]
-
- def get_pretend_option (self):
- return [str(x) for x in self.proxy.get_pretend_option()]
-
- def get_unmerge_option (self):
- return [str(x) for x in self.proxy.get_unmerge_option()]
-
- def get_environment (self):
- default_opts = self.get_global_settings("EMERGE_DEFAULT_OPTS")
- opts = dict(os.environ)
-
- if default_opts:
- opt_list = default_opts.split()
- changed = False
-
- for option in ["--ask", "-a", "--pretend", "-p"]:
- if option in opt_list:
- opt_list.remove(option)
- changed = True
-
- if changed:
- opts.update(EMERGE_DEFAULT_OPTS = " ".join(opt_list))
-
- opts.update(TERM = "xterm")
-
- return opts
diff --git a/portato/backend/portage/system.py b/portato/backend/portage/system.py
index c241a4b..4453df7 100644
--- a/portato/backend/portage/system.py
+++ b/portato/backend/portage/system.py
@@ -194,8 +194,8 @@ class PortageSystem (SystemInterface):
if VERSION >= (2,1,5):
t += [pkg.get_cpv() for pkg in self.find_packages(search_key, self.SET_INSTALLED) if not (pkg.is_testing(True) or pkg.is_masked())]
- else:
- t = self.find_packages(search_key, self.SET_INSTALLED, only_cpv=True)
+ elif not only_installed: # no need to run twice
+ t += self.find_packages(search_key, self.SET_INSTALLED, only_cpv=True)
if t:
t = unique_array(t)
@@ -237,6 +237,19 @@ class PortageSystem (SystemInterface):
"""
new_packages = []
+
+ def append(crit, best, inst):
+ if not best:
+ return
+
+ if not best.is_installed() and (best.is_masked() or best.is_testing(True)): # check to not update unnecessairily
+ for i in inst:
+ if i.matches(crit):
+ debug("The installed %s matches %s. Discarding upgrade to masked version.", i.get_cpv(), crit)
+ return
+
+ new_packages.append(best)
+
for p in packages:
inst = self.find_packages(p, self.SET_INSTALLED)
@@ -256,10 +269,10 @@ class PortageSystem (SystemInterface):
myslots.add(best_p.get_package_settings("SLOT")) # add the slot of the best package in portage
for slot in myslots:
- new_packages.append(\
- self.find_best(self.find_packages("%s:%s" % (i.get_cp(), slot), only_cpv = True)))
+ crit = "%s:%s" % (p, slot)
+ append(crit, self.find_best_match(crit), inst)
else:
- new_packages.append(best_p)
+ append(p, best_p, inst)
return new_packages
@@ -348,15 +361,6 @@ class PortageSystem (SystemInterface):
else:
for pkg in bm:
if not pkg: continue
- if not pkg.is_installed() and (pkg.is_masked() or pkg.is_testing(True)): # check to not update unnecessairily
- cont = False
- for inst in self.find_packages(pkg.get_cp(), self.SET_INSTALLED, only_cpv = True):
- if self.cpv_matches(inst, i):
- debug("The installed %s matches %s. Discarding upgrade to masked version.", inst, i)
- cont = True
- break
- if cont: continue
-
check(pkg, state[1], appended) # XXX: should be 'or'ed with prev_appended?
for p in self.get_new_packages(packages):
diff --git a/portato/config_parser.py b/portato/config_parser.py
index 1383d69..6515d1b 100644
--- a/portato/config_parser.py
+++ b/portato/config_parser.py
@@ -285,8 +285,8 @@ class ConfigParser:
:Exceptions:
- KeyNotFoundException : Raised if the specified key could not be found.
- SectionNotFoundException : Raised if the specified section could not be found.
+ - `KeyNotFoundException` : Raised if the specified key could not be found.
+ - `SectionNotFoundException` : Raised if the specified section could not be found.
"""
try:
@@ -315,8 +315,8 @@ class ConfigParser:
:Exceptions:
- KeyNotFoundException : Raised if the specified key could not be found.
- SectionNotFoundException : Raised if the specified section could not be found.
+ - `KeyNotFoundException` : Raised if the specified key could not be found.
+ - `SectionNotFoundException` : Raised if the specified section could not be found.
"""
section = section.upper()
@@ -339,9 +339,9 @@ class ConfigParser:
:Exceptions:
- KeyNotFoundException : Raised if the specified key could not be found.
- SectionNotFoundException : Raised if the specified section could not be found.
- ValueError : Raised if the key accessed is not a boolean.
+ - `KeyNotFoundException` : Raised if the specified key could not be found.
+ - `SectionNotFoundException` : Raised if the specified section could not be found.
+ - `ValueError` : Raised if the key accessed is not a boolean.
"""
section = section.upper()
@@ -369,8 +369,8 @@ class ConfigParser:
:Exceptions:
- KeyNotFoundException : Raised if the specified key could not be found.
- SectionNotFoundException : Raised if the specified section could not be found.
+ - `KeyNotFoundException` : Raised if the specified key could not be found.
+ - `SectionNotFoundException` : Raised if the specified section could not be found.
"""
section = section.upper()
@@ -394,9 +394,9 @@ class ConfigParser:
:Exceptions:
- KeyNotFoundException : Raised if the specified key could not be found.
- SectionNotFoundException : Raised if the specified section could not be found.
- ValueError : if the old/new value is not a boolean
+ - `KeyNotFoundException` : Raised if the specified key could not be found.
+ - `SectionNotFoundException` : Raised if the specified section could not be found.
+ - `ValueError` : if the old/new value is not a boolean
"""
section = section.upper()
diff --git a/portato/constants.py b/portato/constants.py
index 32f0f9b..3d7217f 100644
--- a/portato/constants.py
+++ b/portato/constants.py
@@ -22,8 +22,6 @@ These should be set during the installation.
@type HOME: string
@var SU_COMMAND: command to execute to "su"
@type SU_COMMAND: string
-@var USE_CATAPULT: use the catapult backend or the normal ones
-@type USE_CATAPULT: boolean
@var CONFIG_DIR: The configuration directory.
@type CONFIG_DIR: string
@@ -45,8 +43,6 @@ These should be set during the installation.
@type SETTINGS_DIR: string
@var TEMPLATE_DIR: Directory containing the UI template files.
@type TEMPLATE_DIR: string
-@var XSD_LOCATION: Path of the plugin schema.
-@type XSD_LOCATION: string
"""
import os
from os.path import join as pjoin
@@ -60,7 +56,6 @@ APP = "portato"
VERSION = "9999"
HOME = os.environ["HOME"]
SU_COMMAND = "gksu -D 'Portato'"
-USE_CATAPULT = False
# config
CONFIG_DIR = "/etc/portato/"
@@ -73,5 +68,3 @@ LOCALE_DIR = "i18n/"
PLUGIN_DIR = pjoin(DATA_DIR, "plugins/")
SETTINGS_DIR = pjoin(HOME, "."+APP)
TEMPLATE_DIR = "portato/gui/templates/"
-
-XSD_LOCATION = pjoin(DATA_DIR, "plugin.xsd")
diff --git a/portato/gui/dialogs.py b/portato/gui/dialogs.py
index 7f8a736..bf7acc7 100644
--- a/portato/gui/dialogs.py
+++ b/portato/gui/dialogs.py
@@ -21,8 +21,8 @@ def mail_failure_dialog(e):
return ret
def queue_not_empty_dialog():
- dialog = gtk.MessageDialog(None, gtk.DIALOG_MODAL, gtk.MESSAGE_QUESTION, gtk.BUTTONS_NONE, _("There are some packages in the emerge queue and/or an emerge process is running.\nDo you really want to quit?"))
- #dialog.add_buttons(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_SAVE, gtk.RESPONSE_YES, gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE)
+ dialog = gtk.MessageDialog(None, gtk.DIALOG_MODAL, gtk.MESSAGE_QUESTION, gtk.BUTTONS_NONE, _("Do you really want to quit?"))
+ dialog.format_secondary_text(_("There are some packages in the emerge queue and/or an emerge process is running."))
dialog.add_buttons(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE)
ret = dialog.run()
dialog.destroy()
@@ -40,7 +40,8 @@ def io_ex_dialog (io_ex):
return ret
def blocked_dialog (blocked, blocks):
- dialog = gtk.MessageDialog(None, gtk.DIALOG_MODAL, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, _("%(blocked)s is blocked by %(blocks)s.\nPlease unmerge the blocking package.") % {"blocked":blocked, "blocks" : blocks})
+ dialog = gtk.MessageDialog(None, gtk.DIALOG_MODAL, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, _("%(blocked)s is blocked by %(blocks)s.") % {"blocked":blocked, "blocks" : blocks})
+ dialog.format_secondary_text(_("Please unmerge the blocking package."))
ret = dialog.run()
dialog.destroy()
return ret
@@ -52,7 +53,8 @@ def not_root_dialog ():
return ret
def unmask_dialog (cpv):
- dialog = gtk.MessageDialog(None, gtk.DIALOG_MODAL, gtk.MESSAGE_QUESTION, gtk.BUTTONS_YES_NO, _("%s seems to be masked.\nDo you want to unmask it and its dependencies?") % cpv)
+ dialog = gtk.MessageDialog(None, gtk.DIALOG_MODAL, gtk.MESSAGE_QUESTION, gtk.BUTTONS_YES_NO, _("%s seems to be masked.") % cpv )
+ dialog.format_secondary_text(_("Do you want to unmask it and its dependencies?"))
ret = dialog.run()
dialog.destroy()
return ret
@@ -65,8 +67,8 @@ def nothing_found_dialog ():
def changed_flags_dialog (what = "flags"):
check = gtk.CheckButton(_("Do not show this dialog again."))
- hintMB = gtk.MessageDialog(None, gtk.DIALOG_MODAL, gtk.MESSAGE_INFO, gtk.BUTTONS_OK,
- _("You have changed %s.\nPortato will write these changes into the appropriate files.\nPlease backup them if you think it is necessairy.") % what)
+ hintMB = gtk.MessageDialog(None, gtk.DIALOG_MODAL, gtk.MESSAGE_INFO, gtk.BUTTONS_OK, _("Changed %s") % what)
+ hintMB.format_secondary_text(_("Portato will write these changes into the appropriate files.\nPlease backup them if you think it is necessairy."))
hintMB.vbox.add(check)
hintMB.vbox.show_all()
ret = hintMB.run()
diff --git a/portato/gui/exception_handling.py b/portato/gui/exception_handling.py
index eadf124..dae95ed 100644
--- a/portato/gui/exception_handling.py
+++ b/portato/gui/exception_handling.py
@@ -100,16 +100,13 @@ def convert (version):
def get_version_infos():
from ..constants import VERSION
from ..backend import system
- from lxml import etree
return "\n".join((
"Portato version: %s" % VERSION,
"Python version: %s" % sys.version,
"Used backend: %s" % system.get_version(),
"pygtk: %s (using GTK+: %s)" % (convert(gtk.pygtk_version), convert(gtk.gtk_version)),
- "pygobject: %s (using GLib: %s)" % (convert(gobject.pygobject_version), convert(gobject.glib_version)),
- "lxml: %s" % convert(etree.LXML_VERSION),
- ""))
+ "pygobject: %s (using GLib: %s)" % (convert(gobject.pygobject_version), convert(gobject.glib_version))))
def get_trace(type, value, tb):
trace = StringIO()
diff --git a/portato/gui/queue.py b/portato/gui/queue.py
index cb5b334..c04d449 100644
--- a/portato/gui/queue.py
+++ b/portato/gui/queue.py
@@ -248,9 +248,9 @@ class EmergeQueue:
self.update_tree(parentIt, cpv, unmask, oneshot = oneshot, type = type)
else: # not update
if type == "install":
- self._queue_append(cpv, oneshot)
if self.tree:
self.update_tree(self.tree.get_emerge_it(), cpv, unmask, type = type, oneshot = oneshot)
+ self._queue_append(cpv, oneshot)
elif type == "update" and self.tree:
self.update_tree(self.tree.get_update_it(), cpv, unmask, type = type, oneshot = oneshot)
diff --git a/portato/gui/templates/PluginWindow.glade b/portato/gui/templates/PluginWindow.glade
index 1de5fc0..f76193e 100644
--- a/portato/gui/templates/PluginWindow.glade
+++ b/portato/gui/templates/PluginWindow.glade
@@ -1,11 +1,12 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
-<!--Generated with glade3 3.4.1 on Fri Feb 29 00:03:30 2008 -->
+<!--Generated with glade3 3.4.5 on Fri Jul 4 15:24:27 2008 -->
<glade-interface>
<widget class="GtkWindow" id="PluginWindow">
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="border_width">5</property>
<property name="title" translatable="yes">Plugins</property>
+ <property name="resizable">False</property>
<property name="modal">True</property>
<property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
<property name="destroy_with_parent">True</property>
@@ -26,6 +27,7 @@
<child>
<widget class="GtkTreeView" id="pluginList">
<property name="visible">True</property>
+ <property name="headers_visible">False</property>
<property name="rules_hint">True</property>
<property name="enable_search">False</property>
</widget>
@@ -33,6 +35,180 @@
</widget>
</child>
<child>
+ <widget class="GtkFrame" id="frame1">
+ <property name="visible">True</property>
+ <property name="label_xalign">0</property>
+ <child>
+ <widget class="GtkTable" id="table1">
+ <property name="visible">True</property>
+ <property name="n_rows">4</property>
+ <property name="n_columns">2</property>
+ <property name="row_spacing">10</property>
+ <child>
+ <widget class="GtkButton" id="installBtn">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="label" translatable="yes">_Install dependencies</property>
+ <property name="use_underline">True</property>
+ <property name="response_id">0</property>
+ <signal name="clicked" handler="cb_install_clicked"/>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="y_options"></property>
+ <property name="x_padding">10</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkExpander" id="depExpander">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <child>
+ <widget class="GtkTreeView" id="depList">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="headers_visible">False</property>
+ <property name="headers_clickable">True</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label4">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Needed dependencies</property>
+ <property name="single_line_mode">True</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_padding">10</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="descrLabel">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">label</property>
+ </widget>
+ <packing>
+ <property name="right_attach">2</property>
+ <property name="y_options">GTK_FILL</property>
+ <property name="y_padding">10</property>
+ </packing>
+ </child>
+