summaryrefslogtreecommitdiff
path: root/grc/python/FlowGraph.py
diff options
context:
space:
mode:
authorTom Rondeau <tom@trondeau.com>2014-07-07 12:18:00 -0400
committerTom Rondeau <tom@trondeau.com>2014-07-07 12:18:00 -0400
commit597b93798a804cde1783d6d2ab53b348d57c44cd (patch)
treeb65e73bb0de634ff5d209b15971ebdabf369a45c /grc/python/FlowGraph.py
parent1151e5502ccd440ebd89599cf7e4be4fb5ed8334 (diff)
Removing trailing/extra whitespaces before release.
We should be more careful about letting these into the code in the future. In emacs, we can use (add-hook 'before-save-hook 'delete-trailing-whitespace).
Diffstat (limited to 'grc/python/FlowGraph.py')
-rw-r--r--grc/python/FlowGraph.py50
1 files changed, 25 insertions, 25 deletions
diff --git a/grc/python/FlowGraph.py b/grc/python/FlowGraph.py
index 8573f33fc4..114f708cb2 100644
--- a/grc/python/FlowGraph.py
+++ b/grc/python/FlowGraph.py
@@ -41,12 +41,12 @@ class FlowGraph(_FlowGraph, _GUIFlowGraph):
def _eval(self, code, namespace, namespace_hash):
"""
Evaluate the code with the given namespace.
-
+
Args:
code: a string with python code
namespace: a dict representing the namespace
namespace_hash: a unique hash for the namespace
-
+
Returns:
the resultant object
"""
@@ -61,10 +61,10 @@ class FlowGraph(_FlowGraph, _GUIFlowGraph):
def get_io_signaturev(self, direction):
"""
Get a list of io signatures for this flow graph.
-
+
Args:
direction: a string of 'in' or 'out'
-
+
Returns:
a list of dicts with: type, label, vlen, size
"""
@@ -90,7 +90,7 @@ class FlowGraph(_FlowGraph, _GUIFlowGraph):
def get_pad_sources(self):
"""
Get a list of pad source blocks sorted by id order.
-
+
Returns:
a list of pad source blocks in this flow graph
"""
@@ -100,7 +100,7 @@ class FlowGraph(_FlowGraph, _GUIFlowGraph):
def get_pad_sinks(self):
"""
Get a list of pad sink blocks sorted by id order.
-
+
Returns:
a list of pad sink blocks in this flow graph
"""
@@ -135,7 +135,7 @@ class FlowGraph(_FlowGraph, _GUIFlowGraph):
def get_imports(self):
"""
Get a set of all import statments in this flow graph namespace.
-
+
Returns:
a set of import statements
"""
@@ -147,7 +147,7 @@ class FlowGraph(_FlowGraph, _GUIFlowGraph):
"""
Get a list of all variables in this flow graph namespace.
Exclude paramterized variables.
-
+
Returns:
a sorted list of variable blocks in order of dependency (indep -> dep)
"""
@@ -157,7 +157,7 @@ class FlowGraph(_FlowGraph, _GUIFlowGraph):
def get_parameters(self):
"""
Get a list of all paramterized variables in this flow graph namespace.
-
+
Returns:
a list of paramterized variables
"""
@@ -174,15 +174,15 @@ class FlowGraph(_FlowGraph, _GUIFlowGraph):
def get_bussink(self):
bussink = filter(lambda b: _bussink_searcher.search(b.get_key()), self.get_enabled_blocks())
-
+
for i in bussink:
for j in i.get_params():
if j.get_name() == 'On/Off' and j.get_value() == 'on':
return True;
-
+
return False
-
-
+
+
def get_bussrc(self):
bussrc = filter(lambda b: _bussrc_searcher.search(b.get_key()), self.get_enabled_blocks())
@@ -191,19 +191,19 @@ class FlowGraph(_FlowGraph, _GUIFlowGraph):
for j in i.get_params():
if j.get_name() == 'On/Off' and j.get_value() == 'on':
return True;
-
+
return False
def get_bus_structure_sink(self):
bussink = filter(lambda b: _bus_struct_sink_searcher.search(b.get_key()), self.get_enabled_blocks())
-
+
return bussink
def get_bus_structure_src(self):
bussrc = filter(lambda b: _bus_struct_src_searcher.search(b.get_key()), self.get_enabled_blocks())
-
+
return bussrc
-
+
def rewrite(self):
"""
@@ -211,19 +211,19 @@ class FlowGraph(_FlowGraph, _GUIFlowGraph):
"""
def reconnect_bus_blocks():
for block in self.get_blocks():
-
+
if 'bus' in map(lambda a: a.get_type(), block.get_sources_gui()):
-
-
+
+
for i in range(len(block.get_sources_gui())):
if len(block.get_sources_gui()[i].get_connections()) > 0:
source = block.get_sources_gui()[i]
sink = []
-
+
for j in range(len(source.get_connections())):
sink.append(source.get_connections()[j].get_sink());
-
-
+
+
for elt in source.get_connections():
self.remove_element(elt);
for j in sink:
@@ -235,11 +235,11 @@ class FlowGraph(_FlowGraph, _GUIFlowGraph):
def evaluate(self, expr):
"""
Evaluate the expression.
-
+
Args:
expr: the string expression
@throw Exception bad expression
-
+
Returns:
the evaluated data
"""