summaryrefslogtreecommitdiff
path: root/grc/python/Generator.py
diff options
context:
space:
mode:
authorSebastian Koslowski <koslowski@kit.edu>2015-09-22 17:16:57 +0200
committerSebastian Koslowski <koslowski@kit.edu>2015-10-01 21:51:09 +0200
commit398e9c12f2ce9c30b2ec9010468739790c2dc0c1 (patch)
tree2481a5b6b7d972cf63cf198be971d0c2814324cf /grc/python/Generator.py
parent6970a408e3f4a60d503149cabc0197c76cd16985 (diff)
grc: per-flowgraph custom run commands
Diffstat (limited to 'grc/python/Generator.py')
-rw-r--r--grc/python/Generator.py14
1 files changed, 4 insertions, 10 deletions
diff --git a/grc/python/Generator.py b/grc/python/Generator.py
index 3c687a2d64..d48be2f00e 100644
--- a/grc/python/Generator.py
+++ b/grc/python/Generator.py
@@ -21,6 +21,7 @@ import os
import sys
import subprocess
import tempfile
+import shlex
from distutils.spawn import find_executable
from Cheetah.Template import Template
@@ -120,20 +121,13 @@ class TopBlockGenerator(object):
Returns:
a popen object
"""
- # extract the path to the python executable
- python_exe = sys.executable
-
- # when using wx gui on mac os, execute with pythonw
- # using pythonw is not necessary anymore, disabled below
- # if self._generate_options == 'wx_gui' and 'darwin' in sys.platform.lower():
- # python_exe = 'pythonw'
-
def args_to_string(args):
"""Accounts for spaces in args"""
return ' '.join(repr(arg) if ' ' in arg else arg for arg in args)
- # setup the command args to run
- cmds = [python_exe, '-u', self.get_file_path()] # -u is unbuffered stdio
+ run_command = self._flow_graph.get_option('run_command')
+ cmds = shlex.split(run_command.format(python=sys.executable,
+ filename=self.get_file_path()))
# when in no gui mode on linux, use a graphical terminal (looks nice)
xterm_executable = find_executable(XTERM_EXECUTABLE)