summaryrefslogtreecommitdiff
path: root/grc/core/FlowGraph.py
diff options
context:
space:
mode:
authorJosh Morman <jmorman@perspectalabs.com>2019-10-08 09:24:32 -0400
committerMarcus Müller <marcus@hostalia.de>2019-11-01 15:31:16 +0100
commit41095980ca9b9562b0c0b354b5a56404b91fe837 (patch)
tree1015eee4959de6692989cea3a19ec731fa0c5d56 /grc/core/FlowGraph.py
parent204df938200712ae4647d3ef7db62f73e22d1a09 (diff)
grc: update namespace properly for nested variables
Was getting lots of evaluation error prints when using gr-digital examples because the nested variables were not updated until rewrite() and evaluate were called over and over Seems to fix the issue to update the flowgraph namespace variable after each variable block is evaluated I believe this also alleviates a previous issue (#2634) where rewrite had to be called twice when data was being imported Fixes #2634
Diffstat (limited to 'grc/core/FlowGraph.py')
-rw-r--r--grc/core/FlowGraph.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/grc/core/FlowGraph.py b/grc/core/FlowGraph.py
index 6c549a46a2..aff5f48bc7 100644
--- a/grc/core/FlowGraph.py
+++ b/grc/core/FlowGraph.py
@@ -226,6 +226,7 @@ class FlowGraph(Element):
variable_block.rewrite()
value = eval(variable_block.value, namespace, variable_block.namespace)
namespace[variable_block.name] = value
+ self.namespace.update(namespace) # rewrite on subsequent blocks depends on an updated self.namespace
except TypeError: #Type Errors may happen, but that desn't matter as they are displayed in the gui
pass
except Exception:
@@ -381,8 +382,7 @@ class FlowGraph(Element):
block.import_data(**block_data)
- self.rewrite() # TODO: Figure out why this has to be called twice to populate bus ports correctly
- self.rewrite() # evaluate stuff like nports before adding connections
+ self.rewrite()
# build the connections
def verify_and_get_port(key, block, dir):