[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 07/16: grc: per-flowgraph custom run comman
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 07/16: grc: per-flowgraph custom run commands |
Date: |
Sat, 3 Oct 2015 19:14:11 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch master
in repository gnuradio.
commit 398e9c12f2ce9c30b2ec9010468739790c2dc0c1
Author: Sebastian Koslowski <address@hidden>
Date: Tue Sep 22 17:16:57 2015 +0200
grc: per-flowgraph custom run commands
---
grc/blocks/options.xml | 14 ++++++++++++++
grc/python/Generator.py | 14 ++++----------
2 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/grc/blocks/options.xml b/grc/blocks/options.xml
index 756a4cd..34822f1 100644
--- a/grc/blocks/options.xml
+++ b/grc/blocks/options.xml
@@ -178,6 +178,18 @@ part#slurp
</option>
<tab>Advanced</tab>
</param>
+ <param>
+ <name>Run Command</name>
+ <key>run_command</key>
+ <value>{python} -u {filename}</value>
+ <type>string</type>
+ <hide>#if $generate_options().startswith('hb')
+all#slurp
+#else
+part#slurp
+#end if</hide>
+ <tab>Advanced</tab>
+ </param>
<check>not $window_size or len($window_size) == 2</check>
<check>not $window_size or 300 <= $(window_size)[0] <=
4096</check>
<check>not $window_size or 300 <= $(window_size)[1] <=
4096</check>
@@ -206,5 +218,7 @@ To put hier blocks into the root category, enter / for the
category.
The Max Number of Output is the maximum number of output items allowed for any
block \
in the flowgraph; to disable this set the max_nouts equal to 0.\
Use this to adjust the maximum latency a flowgraph can exhibit.
+
+
</doc>
</block>
diff --git a/grc/python/Generator.py b/grc/python/Generator.py
index 3c687a2..d48be2f 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)
- [Commit-gnuradio] [gnuradio] branch master updated (222e000 -> 0f9b29a), git, 2015/10/08
- [Commit-gnuradio] [gnuradio] 04/16: gr-dtv: check for SSE2 support, git, 2015/10/08
- [Commit-gnuradio] [gnuradio] 14/16: Merge remote-tracking branch 'mbr0wn/uhd/multi_uhd_fft', git, 2015/10/08
- [Commit-gnuradio] [gnuradio] 12/16: Merge branch 'maint', git, 2015/10/08
- [Commit-gnuradio] [gnuradio] 07/16: grc: per-flowgraph custom run commands,
git <=
- [Commit-gnuradio] [gnuradio] 03/16: uhd: uhd_fft now uses UHDApp, some bugfixes, git, 2015/10/08
- [Commit-gnuradio] [gnuradio] 10/16: grc: simple dialog for selecting QSS theme for QT GUI apps, git, 2015/10/08
- [Commit-gnuradio] [gnuradio] 16/16: Merge remote-tracking branch 'gnuradio-wg-grc/master_grcwg', git, 2015/10/08
- [Commit-gnuradio] [gnuradio] 11/16: grc: added param to set per-flow-graph QT-theme file, git, 2015/10/08
- [Commit-gnuradio] [gnuradio] 01/16: grc: Flowgraph complexity. Shows under options block when enabled., git, 2015/10/08
- [Commit-gnuradio] [gnuradio] 02/16: grc: pad comment boxes like blocks, git, 2015/10/08
- [Commit-gnuradio] [gnuradio] 06/16: grc: add File->New submenu with generate modes preset, Bar.py refactoring, git, 2015/10/08
- [Commit-gnuradio] [gnuradio] 08/16: grc: move generated start-up code into main(), whitespace fixes in generated code, git, 2015/10/08
- [Commit-gnuradio] [gnuradio] 13/16: Merge branch 'maint', git, 2015/10/08
- [Commit-gnuradio] [gnuradio] 09/16: grc: flowgraph template: split arg parser from main(), git, 2015/10/08