diff options
author | Josh Blum | 2009-09-02 13:16:47 -0700 |
---|---|---|
committer | Josh Blum | 2009-09-02 13:16:47 -0700 |
commit | 30513fdc9afa3d8e9d4dce4214299d89aed3c409 (patch) | |
tree | 3eec3f4c3e691c4722d82c04730f0c043d90873c /grc/python/FlowGraph.py | |
parent | 20cf376ab01b02c34f16e242b36ae2a861ba24cb (diff) | |
download | gnuradio-30513fdc9afa3d8e9d4dce4214299d89aed3c409.tar.gz gnuradio-30513fdc9afa3d8e9d4dce4214299d89aed3c409.tar.bz2 gnuradio-30513fdc9afa3d8e9d4dce4214299d89aed3c409.zip |
Removed the flagging api and usage from the base classes.
Far better to flag the namespace for renewing once in the flowgraph.py
Diffstat (limited to 'grc/python/FlowGraph.py')
-rw-r--r-- | grc/python/FlowGraph.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/grc/python/FlowGraph.py b/grc/python/FlowGraph.py index 96188b816..6b2936c75 100644 --- a/grc/python/FlowGraph.py +++ b/grc/python/FlowGraph.py @@ -32,8 +32,8 @@ class FlowGraph(_FlowGraph, _GUIFlowGraph): def __init__(self, **kwargs): _FlowGraph.__init__(self, **kwargs) _GUIFlowGraph.__init__(self) + self._eval_cache = dict() - _eval_cache = dict() def _eval(self, code, namespace, namespace_hash): """ Evaluate the code with the given namespace. @@ -114,6 +114,13 @@ class FlowGraph(_FlowGraph, _GUIFlowGraph): parameters = filter(lambda b: _parameter_matcher.match(b.get_key()), self.get_enabled_blocks()) return parameters + def rewrite(self): + """ + Flag the namespace to be renewed. + """ + self._renew_eval_ns = True + _FlowGraph.rewrite(self) + def evaluate(self, expr): """ Evaluate the expression. @@ -121,8 +128,8 @@ class FlowGraph(_FlowGraph, _GUIFlowGraph): @throw Exception bad expression @return the evaluated data """ - if self.is_flagged(): - self.deflag() + if self._renew_eval_ns: + self._renew_eval_ns = False #reload namespace n = dict() #load imports |