diff options
author | necoro <> | 2006-12-03 19:13:44 +0000 |
---|---|---|
committer | necoro <> | 2006-12-03 19:13:44 +0000 |
commit | 285ef518c9f99349153581d9addba665ba3944eb (patch) | |
tree | 47a9690483df79708c2b6e8e0db1a5478ca64dbf /portato/gui/gui_helper.py | |
parent | 5a10e6a94ac2b47d9c35a31a1c65f7249fd9b203 (diff) | |
download | portato-285ef518c9f99349153581d9addba665ba3944eb.tar.gz portato-285ef518c9f99349153581d9addba665ba3944eb.tar.bz2 portato-285ef518c9f99349153581d9addba665ba3944eb.zip |
Added console-status
Diffstat (limited to '')
-rw-r--r-- | portato/gui/gui_helper.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/portato/gui/gui_helper.py b/portato/gui/gui_helper.py index 6cc09a3..0529767 100644 --- a/portato/gui/gui_helper.py +++ b/portato/gui/gui_helper.py @@ -25,6 +25,7 @@ from wrapper import Console, Tree from subprocess import Popen, PIPE, STDOUT from threading import Thread import pty +import time class Config: """Wrapper around a ConfigParser and for additional local configurations.""" @@ -242,7 +243,7 @@ class Database: class EmergeQueue: """This class manages the emerge queue.""" - def __init__ (self, tree = None, console = None, db = None): + def __init__ (self, tree = None, console = None, db = None, title_update = None): """Constructor. @param tree: Tree to append all the items to. @@ -269,6 +270,7 @@ class EmergeQueue: if self.console and not isinstance(self.console, Console): raise TypeError, "console passed is not a Console-object" 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: @@ -432,8 +434,18 @@ class EmergeQueue: @type packages: list of cpvs @param process: The process we have to wait for before we can do our work. @type process: subprocess.Popen""" + + old_title = self.console.get_window_title() + if process: + while process.poll() == None: + if self.title_update : + title = self.console.get_window_title() + if title != old_title: + self.title_update(title) + time.sleep(0.5) + + if self.title_update: self.title_update(None) - if process: process.wait() for p in packages: if p in ["world", "system"]: continue cat = backend.split_package_name(p)[0] # get category |