From 81169174000ab29bcd651464e830389c62463d5d Mon Sep 17 00:00:00 2001 From: Håkon Vågsether <haakonsv@gmail.com> Date: Sun, 6 Jan 2019 15:17:07 +0100 Subject: 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. --- grc/core/blocks/embedded_python.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'grc/core/blocks/embedded_python.py') 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) -- cgit v1.2.3