summaryrefslogtreecommitdiff
path: root/portato/gui/gui_helper.py
diff options
context:
space:
mode:
authornecoro <>2007-03-15 22:45:43 +0000
committernecoro <>2007-03-15 22:45:43 +0000
commit5138b1e23d34e0a72e0c2f4ae52256e14d825320 (patch)
treee300a29dd1acbd155e9afd9ca0de0036e85bb4a1 /portato/gui/gui_helper.py
parent47a7b294e5a889afb932d371021d2b53adc20665 (diff)
downloadportato-5138b1e23d34e0a72e0c2f4ae52256e14d825320.tar.gz
portato-5138b1e23d34e0a72e0c2f4ae52256e14d825320.tar.bz2
portato-5138b1e23d34e0a72e0c2f4ae52256e14d825320.zip
Added etc-proposals plugin
Diffstat (limited to 'portato/gui/gui_helper.py')
-rw-r--r--portato/gui/gui_helper.py51
1 files changed, 30 insertions, 21 deletions
diff --git a/portato/gui/gui_helper.py b/portato/gui/gui_helper.py
index 79064b6..ecc3ba6 100644
--- a/portato/gui/gui_helper.py
+++ b/portato/gui/gui_helper.py
@@ -14,6 +14,7 @@
from portato import backend
from portato.backend import flags, system, set_system
from portato.helper import *
+from portato import plugin
# parser
from portato.config_parser import ConfigParser
@@ -280,7 +281,7 @@ class EmergeQueue:
self.db = db
self.title_update = title_update
-
+
# our iterators pointing at the toplevels; they are set to None if we do not have a tree
if self.tree:
self.emergeIt = self.tree.get_emerge_it()
@@ -455,11 +456,15 @@ class EmergeQueue:
if self.title_update: self.title_update(None)
- for p in packages:
- if p in ["world", "system"]: continue
- cat = system.split_cpv(p)[0] # get category
- self.db.reload(cat)
- debug("Category %s refreshed" % cat)
+ @plugin.hook("after_emerge", packages)
+ def update_packages():
+ for p in packages:
+ if p in ["world", "system"]: continue
+ cat = system.split_cpv(p)[0] # get category
+ self.db.reload(cat)
+ debug("Category %s refreshed" % cat)
+
+ update_packages()
def _emerge (self, options, packages, it, command = None):
"""Calls emerge and updates the terminal.
@@ -473,22 +478,26 @@ class EmergeQueue:
@param command: the command to execute - default is "/usr/bin/python /usr/bin/emerge"
@type command: string[]"""
- if command is None:
- command = system.get_merge_command()
+ @plugin.hook("emerge", packages, command)
+ def sub_emerge(command):
+ if command is None:
+ command = system.get_merge_command()
- # open tty
- (master, slave) = pty.openpty()
- self.console.set_pty(master)
-
- # start emerge
- self.process = Popen(command+options+packages, stdout = slave, stderr = STDOUT, shell = False)
-
- # start thread waiting for the stop of emerge
- Thread(name="Emerge-Thread", target=self._update_packages, args=(packages+self.deps.keys(), self.process)).start()
-
- # remove
- for i in it:
- self.remove_with_children(i)
+ # open tty
+ (master, slave) = pty.openpty()
+ self.console.set_pty(master)
+
+ # start emerge
+ self.process = Popen(command+options+packages, stdout = slave, stderr = STDOUT, shell = False)
+
+ # start thread waiting for the stop of emerge
+ Thread(name="Emerge-Thread", target=self._update_packages, args=(packages+self.deps.keys(), self.process)).start()
+
+ # remove
+ for i in it:
+ self.remove_with_children(i)
+
+ sub_emerge(command)
def emerge (self, force = False):
"""Emerges everything in the merge-queue.