diff options
author | Sebastian Koslowski <koslowski@kit.edu> | 2014-09-18 10:01:15 -0400 |
---|---|---|
committer | Sebastian Koslowski <koslowski@kit.edu> | 2014-10-01 16:38:23 +0200 |
commit | 71aad443dfd5dd75942babec5ba26b55a71e79fc (patch) | |
tree | d7da00af7a60e503c60aeb87e08d18c037ce0dcf /grc/gui/ActionHandler.py | |
parent | 1cc5fcde337a3b10d6be4a71c26780cce0648c69 (diff) |
grc: show fg return code if not 0 (Bug #726)
Diffstat (limited to 'grc/gui/ActionHandler.py')
-rw-r--r-- | grc/gui/ActionHandler.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/grc/gui/ActionHandler.py b/grc/gui/ActionHandler.py index c06dc9671f..2e968faf5b 100644 --- a/grc/gui/ActionHandler.py +++ b/grc/gui/ActionHandler.py @@ -491,9 +491,11 @@ class ActionHandler: ExecFlowGraphThread(self) elif action == Actions.FLOW_GRAPH_KILL: if self.get_page().get_proc(): - try: self.get_page().get_proc().kill() - except: print "could not kill process: %d"%self.get_page().get_proc().pid - elif action == Actions.PAGE_CHANGE: #pass and run the global actions + try: + self.get_page().get_proc().kill() + except: + print "could not kill process: %d" % self.get_page().get_proc().pid + elif action == Actions.PAGE_CHANGE: # pass and run the global actions pass elif action == Actions.RELOAD_BLOCKS: self.platform.load_blocks() @@ -579,7 +581,7 @@ class ActionHandler: sensitive = self.get_flow_graph().is_valid() and not self.get_page().get_proc() Actions.FLOW_GRAPH_GEN.set_sensitive(sensitive) Actions.FLOW_GRAPH_EXEC.set_sensitive(sensitive) - Actions.FLOW_GRAPH_KILL.set_sensitive(self.get_page().get_proc() != None) + Actions.FLOW_GRAPH_KILL.set_sensitive(self.get_page().get_proc() is not None) class ExecFlowGraphThread(Thread): """Execute the flow graph as a new process and wait on it to finish.""" @@ -615,13 +617,14 @@ class ExecFlowGraphThread(Thread): """ #handle completion r = "\n" - while(r): + while r: gobject.idle_add(Messages.send_verbose_exec, r) r = os.read(self.p.stdout.fileno(), 1024) + self.p.poll() gobject.idle_add(self.done) def done(self): """Perform end of execution tasks.""" - Messages.send_end_exec() + Messages.send_end_exec(self.p.returncode) self.page.set_proc(None) self.update_exec_stop() |