diff options
author | Matt Ettus | 2009-09-24 22:34:06 -0700 |
---|---|---|
committer | Matt Ettus | 2009-09-24 22:34:06 -0700 |
commit | 5c46578ba936de57e80594540804c964aa408f73 (patch) | |
tree | cf164f8e3d80b78971fb2987740b7d957ee1f306 /grc/python/Block.py | |
parent | 35ada01aa8ae838d6d75bf063725218fa7e18f5f (diff) | |
parent | 16474a0adb44dc81a8338a9c4a9a6dcab6f6328f (diff) | |
download | gnuradio-5c46578ba936de57e80594540804c964aa408f73.tar.gz gnuradio-5c46578ba936de57e80594540804c964aa408f73.tar.bz2 gnuradio-5c46578ba936de57e80594540804c964aa408f73.zip |
Merge commit 'origin' into new_eth
Conflicts:
.gitignore
Diffstat (limited to 'grc/python/Block.py')
-rw-r--r-- | grc/python/Block.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/grc/python/Block.py b/grc/python/Block.py index 47fe13a3c..dd39b095d 100644 --- a/grc/python/Block.py +++ b/grc/python/Block.py @@ -18,10 +18,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA """ from .. base.Block import Block as _Block +from .. gui.Block import Block as _GUIBlock import extract_docs import extract_category -class Block(_Block): +class Block(_Block, _GUIBlock): + + def is_virtual_sink(self): return self.get_key() == 'virtual_sink' + def is_virtual_source(self): return self.get_key() == 'virtual_source' ##for make source to keep track of indexes _source_count = 0 @@ -48,13 +52,13 @@ class Block(_Block): flow_graph=flow_graph, n=n, ) + _GUIBlock.__init__(self) def validate(self): """ Validate this block. Call the base class validate. Evaluate the checks: each check must evaluate to True. - Adjust the nports. """ _Block.validate(self) #evaluate the checks @@ -65,6 +69,12 @@ class Block(_Block): try: assert check_eval except AssertionError: self.add_error_message('Check "%s" failed.'%check) except: self.add_error_message('Check "%s" did not evaluate.'%check) + + def rewrite(self): + """ + Add and remove ports to adjust for the nports. + """ + _Block.rewrite(self) #adjust nports for get_ports, get_port in ( (self.get_sources, self.get_source), |