diff options
author | Sebastian Koslowski <sebastian.koslowski@gmail.com> | 2019-02-07 22:41:39 +0100 |
---|---|---|
committer | Sebastian Koslowski <sebastian.koslowski@gmail.com> | 2019-02-12 11:46:09 +0100 |
commit | b17a9b3f0672318cb6fa240d14aed14ffffebe69 (patch) | |
tree | f98e7f0a3b999a18d921d890eb25f093f8300e3a /grc/core/blocks/embedded_python.py | |
parent | b65911e6ee71ad8ce7085cc6b781744e816f7ae8 (diff) |
grc: fixes in epy and virtual blocks (fixes #2039)
Diffstat (limited to 'grc/core/blocks/embedded_python.py')
-rw-r--r-- | grc/core/blocks/embedded_python.py | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/grc/core/blocks/embedded_python.py b/grc/core/blocks/embedded_python.py index 57cf0ee4e9..548739ed52 100644 --- a/grc/core/blocks/embedded_python.py +++ b/grc/core/blocks/embedded_python.py @@ -26,7 +26,8 @@ from ._templates import MakoTemplates from .. import utils from ..base import Element -from ._build import _build_params as build_core_params +from ._build import build_params + DEFAULT_CODE = '''\ """ @@ -82,13 +83,12 @@ class EPyBlock(Block): label = 'Python Block' documentation = {'': DOC} - parameters_data = [dict( - label='Code', - id='_source_code', - dtype='_multiline_python_external', - default=DEFAULT_CODE, - hide='part', - )] + parameters_data = build_params( + params_raw=[ + dict(label='Code', id='_source_code', dtype='_multiline_python_external', + default=DEFAULT_CODE, hide='part') + ], have_inputs=True, have_outputs=True, flags=Block.flags, block_id=key + ) inputs_data = [] outputs_data = [] @@ -230,18 +230,14 @@ class EPyModule(Block): to set parameters of other blocks in your flowgraph. """)} - parameters = [dict( - label='Code', - id='source_code', - dtype='_multiline_python_external', - default='# this module will be imported in the into your flowgraph', - hide='part', - )] + parameters_data = build_params( + params_raw=[ + dict(label='Code', id='source_code', dtype='_multiline_python_external', + default='# this module will be imported in the into your flowgraph', + hide='part') + ], have_inputs=False, have_outputs=False, flags=Block.flags, block_id=key + ) templates = MakoTemplates( imports='import ${ id } # embedded python module', ) - - def __init__(self, flow_graph, **kwargs): - self.parameters_data = build_core_params(self.parameters, False, False, self.flags, self.key) - super(EPyModule, self).__init__(flow_graph, **kwargs) |