summaryrefslogtreecommitdiff
path: root/grc
diff options
context:
space:
mode:
authorjblum2008-08-28 19:29:40 +0000
committerjblum2008-08-28 19:29:40 +0000
commit0e57dc43594230d8966d7d1893bad0ae466c5162 (patch)
treee4d38ae77c16b626a229e236422719f12a9396a1 /grc
parent924b8d43fefaed5b8b0ed37c5ffb6f846d225609 (diff)
downloadgnuradio-0e57dc43594230d8966d7d1893bad0ae466c5162.tar.gz
gnuradio-0e57dc43594230d8966d7d1893bad0ae466c5162.tar.bz2
gnuradio-0e57dc43594230d8966d7d1893bad0ae466c5162.zip
temp fix for to_code error
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@9440 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'grc')
-rw-r--r--grc/src/grc_gnuradio/FlowGraph.py33
-rw-r--r--grc/src/grc_gnuradio/Param.py3
2 files changed, 17 insertions, 19 deletions
diff --git a/grc/src/grc_gnuradio/FlowGraph.py b/grc/src/grc_gnuradio/FlowGraph.py
index 238b44ca5..42783aab3 100644
--- a/grc/src/grc_gnuradio/FlowGraph.py
+++ b/grc/src/grc_gnuradio/FlowGraph.py
@@ -23,7 +23,6 @@ from utils import expr_utils
from grc.elements.FlowGraph import FlowGraph as _FlowGraph
from Block import Block
from Connection import Connection
-import traceback
class FlowGraph(_FlowGraph):
@@ -81,23 +80,21 @@ class FlowGraph(_FlowGraph):
Exclude paramterized variables.
@return a sorted list of variable blocks in order of dependency (indep -> dep)
"""
- try:
- variables = filter(lambda b: b.get_key() in (
- 'variable', 'variable_slider', 'variable_chooser', 'variable_text_box'
- ), self.get_enabled_blocks())
- #map var id to variable block
- id2var = dict([(var.get_id(), var) for var in variables])
- #map var id to variable code
- #variable code is a concatenation of all param code (without the id param)
- id2expr = dict([(var.get_id(),
- ' '.join([param.to_code() for param in filter(lambda p: p.get_key() != 'id',var.get_params())])
- ) for var in variables])
- #sort according to dependency
- sorted_ids = expr_utils.sort_variables(id2expr)
- #create list of sorted variable blocks
- variables = [id2var[id] for id in sorted_ids]
- return variables
- except: traceback.print_exc()
+ variables = filter(lambda b: b.get_key() in (
+ 'variable', 'variable_slider', 'variable_chooser', 'variable_text_box'
+ ), self.get_enabled_blocks())
+ #map var id to variable block
+ id2var = dict([(var.get_id(), var) for var in variables])
+ #map var id to variable code
+ #variable code is a concatenation of all param code (without the id param)
+ id2expr = dict([(var.get_id(),
+ ' '.join([param.to_code() for param in filter(lambda p: p.get_key() != 'id', var.get_params())])
+ ) for var in variables])
+ #sort according to dependency
+ sorted_ids = expr_utils.sort_variables(id2expr)
+ #create list of sorted variable blocks
+ variables = [id2var[id] for id in sorted_ids]
+ return variables
def get_parameters(self):
"""!
diff --git a/grc/src/grc_gnuradio/Param.py b/grc/src/grc_gnuradio/Param.py
index f0ea25c0e..b6d5250df 100644
--- a/grc/src/grc_gnuradio/Param.py
+++ b/grc/src/grc_gnuradio/Param.py
@@ -227,7 +227,8 @@ class Param(_Param):
"""
#run init tasks in evaluate
if not self._init:
- self.evaluate()
+ try: self.evaluate()
+ except: pass
self._init = True
v = self.get_value()
t = self.get_type()