summaryrefslogtreecommitdiff
path: root/grc/core/blocks/embedded_python.py
diff options
context:
space:
mode:
authorHåkon Vågsether <haakonsv@gmail.com>2019-01-06 15:17:07 +0100
committerMartin Braun <martin.braun@ettus.com>2019-01-07 09:36:13 -0800
commit81169174000ab29bcd651464e830389c62463d5d (patch)
treee0f6b1880ee4eaaf4e9fcb8055bca8c24a90cef0 /grc/core/blocks/embedded_python.py
parent41b4b6a2b835917c7616fe700a632eca8e4c8199 (diff)
grc: Fix Python Module block
Before this fix, it was not possible to add a 'Python Module' to a GRC flow graph, it would just throw exceptions when you tried.
Diffstat (limited to 'grc/core/blocks/embedded_python.py')
-rw-r--r--grc/core/blocks/embedded_python.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/grc/core/blocks/embedded_python.py b/grc/core/blocks/embedded_python.py
index 0b5a7a21c5..29791e1a52 100644
--- a/grc/core/blocks/embedded_python.py
+++ b/grc/core/blocks/embedded_python.py
@@ -26,6 +26,7 @@ from ._templates import MakoTemplates
from .. import utils
from ..base import Element
+from ._build import _build_params as build_core_params
DEFAULT_CODE = '''\
"""
@@ -229,7 +230,7 @@ class EPyModule(Block):
to set parameters of other blocks in your flowgraph.
""")}
- parameters_data = [dict(
+ parameters = [dict(
label='Code',
id='source_code',
dtype='_multiline_python_external',
@@ -240,3 +241,7 @@ class EPyModule(Block):
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)