summaryrefslogtreecommitdiff
path: root/grc/python/Generator.py
diff options
context:
space:
mode:
authorjblum2009-07-06 02:28:52 +0000
committerjblum2009-07-06 02:28:52 +0000
commit25c5d91fb7c4b54f1e7d77fd9af213a3675a8339 (patch)
tree317d2e623aa9de602197089dab6dcc4fbb17da6f /grc/python/Generator.py
parenta6396abe127c504f890d0cd45171c46ebfbb0f3d (diff)
downloadgnuradio-25c5d91fb7c4b54f1e7d77fd9af213a3675a8339.tar.gz
gnuradio-25c5d91fb7c4b54f1e7d77fd9af213a3675a8339.tar.bz2
gnuradio-25c5d91fb7c4b54f1e7d77fd9af213a3675a8339.zip
Merged r11309:11357 from grc branch.
Adds notebook cabability to grc and its wxgui windows/controls. git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@11358 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'grc/python/Generator.py')
-rw-r--r--grc/python/Generator.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/grc/python/Generator.py b/grc/python/Generator.py
index cde7dc3d4..33be4a726 100644
--- a/grc/python/Generator.py
+++ b/grc/python/Generator.py
@@ -90,7 +90,13 @@ Add a Misc->Throttle block to your flow graph to avoid CPU congestion.''')
#list of blocks not including variables and imports and parameters and disabled
blocks = sorted(self._flow_graph.get_enabled_blocks(), lambda x, y: cmp(x.get_id(), y.get_id()))
probes = filter(lambda b: b.get_key().startswith('probe_'), blocks) #ensure probes are last in the block list
- blocks = filter(lambda b: b not in (imports + parameters + variables + probes), blocks) + probes
+ #get a list of notebooks and sort them according dependencies
+ notebooks = expr_utils.sort_objects(
+ filter(lambda b: b.get_key() == 'notebook', blocks),
+ lambda n: n.get_id(), lambda n: n.get_param('notebook').get_value(),
+ )
+ #list of regular blocks (all blocks minus the special ones)
+ blocks = filter(lambda b: b not in (imports + parameters + variables + probes + notebooks), blocks) + probes
#list of connections where each endpoint is enabled
connections = self._flow_graph.get_enabled_connections()
#list of variable names
@@ -113,6 +119,7 @@ Add a Misc->Throttle block to your flow graph to avoid CPU congestion.''')
'imports': imports,
'flow_graph': self._flow_graph,
'variables': variables,
+ 'notebooks': notebooks,
'controls': controls,
'parameters': parameters,
'blocks': blocks,