diff options
Diffstat (limited to 'grc/gui/Executor.py')
-rw-r--r-- | grc/gui/Executor.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/grc/gui/Executor.py b/grc/gui/Executor.py index bf9eecb9a8..a8c67986e5 100644 --- a/grc/gui/Executor.py +++ b/grc/gui/Executor.py @@ -15,7 +15,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA -import gobject +from __future__ import absolute_import import os import threading import shlex @@ -24,6 +24,8 @@ import sys import re from distutils.spawn import find_executable +from gi.repository import GLib + from ..core import Messages @@ -44,8 +46,7 @@ class ExecFlowGraphThread(threading.Thread): self.update_callback = callback try: - self.process = self._popen() - self.page.set_proc(self.process) + self.process = self.page.process = self._popen() self.update_callback() self.start() except Exception as e: @@ -56,7 +57,7 @@ class ExecFlowGraphThread(threading.Thread): """ Execute this python flow graph. """ - run_command = self.page.get_flow_graph().get_option('run_command') + run_command = self.page.flow_graph.get_option('run_command') generator = self.page.get_generator() try: @@ -86,20 +87,20 @@ class ExecFlowGraphThread(threading.Thread): def run(self): """ Wait on the executing process by reading from its stdout. - Use gobject.idle_add when calling functions that modify gtk objects. + Use GObject.idle_add when calling functions that modify gtk objects. """ # handle completion r = "\n" while r: - gobject.idle_add(Messages.send_verbose_exec, r) + GLib.idle_add(Messages.send_verbose_exec, r) r = os.read(self.process.stdout.fileno(), 1024) self.process.poll() - gobject.idle_add(self.done) + GLib.idle_add(self.done) def done(self): """Perform end of execution tasks.""" Messages.send_end_exec(self.process.returncode) - self.page.set_proc(None) + self.page.process = None self.update_callback() |