From b5e8e2eb2b8bc9936070028ecf91ff8d0b7c33ef Mon Sep 17 00:00:00 2001 From: necoro <> Date: Wed, 11 Jul 2007 07:37:22 +0000 Subject: added SIGSTOP/SIGCONT support; SIGTERM now works ;) --- portato/gui/gui_helper.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'portato/gui/gui_helper.py') diff --git a/portato/gui/gui_helper.py b/portato/gui/gui_helper.py index 358f56e..8ee858f 100644 --- a/portato/gui/gui_helper.py +++ b/portato/gui/gui_helper.py @@ -624,9 +624,8 @@ class EmergeQueue: """Kills the emerge process.""" if self.process is not None: try: - os.kill(self.process.pid, signal.SIGTERM) + send_signal_to_group(signal.SIGTERM) debug("Process should be killed") - os.kill(self.process.pid, signal.SIGKILL) # to be sure except AttributeError: debug("AttributeError occured ==> process not exisiting - ignore") except OSError: @@ -634,6 +633,17 @@ class EmergeQueue: self.process = None + def stop_emerge (self): + if self.process is not None: + # use SIGTSTP in favor of SIGSTOP, as SIGSTOP cannot be blocked and would stop the GUI too + send_signal_to_group(signal.SIGTSTP) + debug("Process should be stopped") + + def continue_emerge (self): + if self.process is not None: + send_signal_to_group(signal.SIGCONT) + debug("Process should continue") + def remove_with_children (self, it, removeNewFlags = True): """Convenience function which removes all children of an iterator and than the iterator itself. -- cgit v1.2.3-70-g09d2