summaryrefslogtreecommitdiff
path: root/grc/base/Block.py
diff options
context:
space:
mode:
Diffstat (limited to 'grc/base/Block.py')
-rw-r--r--grc/base/Block.py50
1 files changed, 37 insertions, 13 deletions
diff --git a/grc/base/Block.py b/grc/base/Block.py
index a20be9db96..223f3183b7 100644
--- a/grc/base/Block.py
+++ b/grc/base/Block.py
@@ -54,9 +54,13 @@ class Block(Element):
def __init__(self, flow_graph, n):
"""
Make a new block from nested data.
- @param flow graph the parent element
- @param n the nested odict
- @return block a new block
+
+ Args:
+ flow: graph the parent element
+ n: the nested odict
+
+ Returns:
+ block a new block
"""
#build the block
Element.__init__(self, flow_graph)
@@ -119,7 +123,9 @@ class Block(Element):
def get_enabled(self):
"""
Get the enabled state of the block.
- @return true for enabled
+
+ Returns:
+ true for enabled
"""
try: return eval(self.get_param('_enabled').get_value())
except: return True
@@ -127,7 +133,9 @@ class Block(Element):
def set_enabled(self, enabled):
"""
Set the enabled state of the block.
- @param enabled true for enabled
+
+ Args:
+ enabled: true for enabled
"""
self.get_param('_enabled').set_value(str(enabled))
@@ -170,8 +178,12 @@ class Block(Element):
def resolve_dependencies(self, tmpl):
"""
Resolve a paramater dependency with cheetah templates.
- @param tmpl the string with dependencies
- @return the resolved value
+
+ Args:
+ tmpl: the string with dependencies
+
+ Returns:
+ the resolved value
"""
tmpl = str(tmpl)
if '$' not in tmpl: return tmpl
@@ -185,8 +197,12 @@ class Block(Element):
def type_controller_modify(self, direction):
"""
Change the type controller.
- @param direction +1 or -1
- @return true for change
+
+ Args:
+ direction: +1 or -1
+
+ Returns:
+ true for change
"""
changed = False
type_param = None
@@ -210,8 +226,12 @@ class Block(Element):
def port_controller_modify(self, direction):
"""
Change the port controller.
- @param direction +1 or -1
- @return true for change
+
+ Args:
+ direction: +1 or -1
+
+ Returns:
+ true for change
"""
return False
@@ -221,7 +241,9 @@ class Block(Element):
def export_data(self):
"""
Export this block's params to nested data.
- @return a nested data odict
+
+ Returns:
+ a nested data odict
"""
n = odict()
n['key'] = self.get_key()
@@ -236,7 +258,9 @@ class Block(Element):
call rewrite, and repeat the load until the params stick.
This call to rewrite will also create any dynamic ports
that are needed for the connections creation phase.
- @param n the nested data odict
+
+ Args:
+ n: the nested data odict
"""
get_hash = lambda: hash(tuple(map(hash, self.get_params())))
my_hash = 0