commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 05/16: grc: move xterm pref to Constants.py


From: git
Subject: [Commit-gnuradio] [gnuradio] 05/16: grc: move xterm pref to Constants.py
Date: Sun, 16 Feb 2014 21:11:20 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

trondeau pushed a commit to branch master
in repository gnuradio.

commit e9ff54269ac473fbb1f892307e7f1f421b130db4
Author: Sebastian Koslowski <address@hidden>
Date:   Sun Feb 2 12:02:25 2014 +0100

    grc: move xterm pref to Constants.py
---
 grc/python/Constants.py | 3 +++
 grc/python/Generator.py | 8 +++-----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/grc/python/Constants.py b/grc/python/Constants.py
index 15cc203..0e974df 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 62e7bca..9bafeb0 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]