diff options
author | necoro <> | 2007-07-11 07:37:22 +0000 |
---|---|---|
committer | necoro <> | 2007-07-11 07:37:22 +0000 |
commit | b5e8e2eb2b8bc9936070028ecf91ff8d0b7c33ef (patch) | |
tree | 366a8a3656d01dc2e30f28943c898a2578211409 /portato/gui/gui_helper.py | |
parent | 3637bd7900f3b480b5935279c598c39bee70a03e (diff) | |
download | portato-b5e8e2eb2b8bc9936070028ecf91ff8d0b7c33ef.tar.gz portato-b5e8e2eb2b8bc9936070028ecf91ff8d0b7c33ef.tar.bz2 portato-b5e8e2eb2b8bc9936070028ecf91ff8d0b7c33ef.zip |
added SIGSTOP/SIGCONT support; SIGTERM now works ;)
Diffstat (limited to '')
-rw-r--r-- | portato/gui/gui_helper.py | 14 |
1 files changed, 12 insertions, 2 deletions
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. |