summaryrefslogtreecommitdiff
path: root/grc/python
diff options
context:
space:
mode:
Diffstat (limited to 'grc/python')
-rw-r--r--grc/python/Constants.py3
-rw-r--r--grc/python/Generator.py8
2 files changed, 6 insertions, 5 deletions
diff --git a/grc/python/Constants.py b/grc/python/Constants.py
index 15cc203b43..0e974df43c 100644
--- a/grc/python/Constants.py
+++ b/grc/python/Constants.py
@@ -34,6 +34,9 @@ BLOCKS_DIRS = filter( #filter blank strings
]).split(PATH_SEP),
) + [HIER_BLOCKS_LIB_DIR]
+#user settings
+XTERM_EXECUTABLE = _gr_prefs.get_string('grc', 'xterm_executable', 'xterm')
+
#file creation modes
TOP_BLOCK_FILE_MODE = stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR | stat.S_IRGRP | stat.S_IWGRP | stat.S_IXGRP | stat.S_IROTH
HIER_BLOCK_FILE_MODE = stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IWGRP | stat.S_IROTH
diff --git a/grc/python/Generator.py b/grc/python/Generator.py
index 62e7bcad44..9bafeb0683 100644
--- a/grc/python/Generator.py
+++ b/grc/python/Generator.py
@@ -24,11 +24,10 @@ import tempfile
from Cheetah.Template import Template
import expr_utils
from Constants import \
- TOP_BLOCK_FILE_MODE, HIER_BLOCK_FILE_MODE, \
- HIER_BLOCKS_LIB_DIR, FLOW_GRAPH_TEMPLATE
+ TOP_BLOCK_FILE_MODE, HIER_BLOCK_FILE_MODE, HIER_BLOCKS_LIB_DIR, FLOW_GRAPH_TEMPLATE, XTERM_EXECUTABLE
import convert_hier
from .. gui import Messages
-from gnuradio import gr
+
class Generator(object):
@@ -91,9 +90,8 @@ Add a Misc->Throttle block to your flow graph to avoid CPU congestion.''')
cmds = [python_exe, '-u', self.get_file_path()] #-u is unbuffered stdio
#when in no gui mode on linux, use an xterm (looks nice)
- xterm_executable = gr.prefs().get_string('grc', 'xterm_executable', 'xterm')
if self._generate_options == 'no_gui' and 'linux' in sys.platform.lower():
- cmds = [xterm_executable, '-e'] + cmds
+ cmds = [XTERM_EXECUTABLE, '-e'] + cmds
p = subprocess.Popen(args=cmds, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=False, universal_newlines=True)
return p