summaryrefslogtreecommitdiff
path: root/portato/gui
diff options
context:
space:
mode:
Diffstat (limited to 'portato/gui')
-rw-r--r--portato/gui/gtk/windows.py14
-rw-r--r--portato/gui/gui_helper.py51
2 files changed, 39 insertions, 26 deletions
diff --git a/portato/gui/gtk/windows.py b/portato/gui/gtk/windows.py
index d67bcfd..a27d156 100644
--- a/portato/gui/gtk/windows.py
+++ b/portato/gui/gtk/windows.py
@@ -24,7 +24,7 @@ from portato.backend import flags, system
from portato.backend.exceptions import *
# plugins
-from portato.plugin import PluginQueue
+from portato import plugin
# more GUI stuff
from portato.gui.gui_helper import Database, Config, EmergeQueue
@@ -626,7 +626,7 @@ class PackageTable:
return True
def cb_package_ebuild_clicked(self, button):
- hook = self.main.pluginQueue.hook("open_ebuild", self.actual_package(), self.window)
+ hook = plugin.hook("open_ebuild", self.actual_package(), self.window)
hook(EbuildWindow)(self.window, self.actual_package())
return True
@@ -720,8 +720,7 @@ class MainWindow (Window):
self.cfg.modify_external_configs()
- # plugins
- self.pluginQueue = PluginQueue()
+ plugin.load_plugins()
# set vpaned position
vpaned = self.tree.get_widget("vpaned")
@@ -1020,7 +1019,12 @@ class MainWindow (Window):
return True
def cb_about_clicked (self, button):
- AboutWindow(self.window, self.pluginQueue.get_plugin_data())
+ queue = plugin.get_plugins()
+ if queue is None:
+ queue = []
+ else:
+ queue = queue.get_plugin_data()
+ AboutWindow(self.window, queue)
return True
def cb_right_click (self, object, event):
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.
plates/AboutWindow.ui?h=no_config&id=4e2bccb1b75c2cdb38b1365108074fbb97eaf0c7&follow=1'>Added Italian translation. Thanks to Ponsi.René 'Necoro' Neumann3-0/+1166 2009-10-28Changelogv0.13.10.13René 'Necoro' Neumann1-0/+4 2009-10-28Corrected config path handling.René 'Necoro' Neumann2-9/+6 2009-10-28Corrected config path handling.René 'Necoro' Neumann2-9/+6 2009-10-24Fix the segfault in GLib due to wrong encodingRené 'Necoro' Neumann1-0/+1 2009-10-24Wrong debug message in new_version pluginRené 'Necoro' Neumann1-1/+1 2009-10-24Update TRANSLATING to use gitRené 'Necoro' Neumann1-2/+15 2009-10-24Also show revision during startup and with -vRené 'Necoro' Neumann1-1/+5 2009-10-24Adding revison info to version output.René 'Necoro' Neumann3-2/+44 2009-10-23Turn new_version plugin from a mess into sth useful.René 'Necoro' Neumann2-10/+10 2009-10-23Honor branches different from masterRené 'Necoro' Neumann1-2/+4 2009-10-23Change the new_version plugin to use git.René 'Necoro' Neumann2-32/+33 2009-10-15Objectified all the functional stuff in backend.__init__.René 'Necoro' Neumann2-32/+34 2009-10-08Enhance the splash window handling.René 'Necoro' Neumann2-2/+9 2009-10-08Enhance the splash window handling.René 'Necoro' Neumann2-2/+9 2009-10-05Some more stuff to ignoreRené 'Necoro' Neumann1-0/+3 2009-10-05Renamed the ignore fileRené 'Necoro' Neumann1-0/+0 2009-10-05Update NEWSRené 'Necoro' Neumann1-0/+1 2009-10-05Also allow 'unselect all' in the PkgListRené 'Necoro' Neumann1-1/+10 2009-10-05Now have it the sorted way in PkgListsRené 'Necoro' Neumann2-3/+9 2009-10-05Enhanced system.sort_package_list to also sort CPVsRené 'Necoro' Neumann5-27/+38 2009-10-05Added an PkgList window and rewrote UpdateWindow and WorldListWindow to use itRené 'Necoro' Neumann3-39/+63 2009-10-05Add uninstall button and rename to PkgListWindowRené 'Necoro' Neumann1-2/+17 2009-10-05First quick hack to have a world listRené 'Necoro' Neumann3-2/+24