diff options
author | Josh Morman <mormjb@gmail.com> | 2020-03-13 15:19:24 -0400 |
---|---|---|
committer | Michael Dickens <michael.dickens@ettus.com> | 2020-03-26 11:04:58 -0400 |
commit | c164d3427036bf57af9751380b731b7cd99a4f4a (patch) | |
tree | 53a71f2f4d3144690f730f92223f36c4036ae155 /grc | |
parent | d09576b9107b086f70edb4a96fbbc8bc11f82fbc (diff) |
grc: workaround to allow epy blocks/modules to load
The underlying issue is that the built in blocks all end up getting the
'cpp' flag, which is not valid for the embedded python blocks
To fix this some work needs to be done in the "Flags" class, as all the
flags added to classes that get accumulated in the build_ins list get
added to all the classes
See register_build_in
Diffstat (limited to 'grc')
-rw-r--r-- | grc/core/blocks/block.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/grc/core/blocks/block.py b/grc/core/blocks/block.py index 3c588a6359..a5d17db92f 100644 --- a/grc/core/blocks/block.py +++ b/grc/core/blocks/block.py @@ -77,8 +77,11 @@ class Block(Element): self.states = {'state': True, 'bus_source': False, 'bus_sink': False, 'bus_structure': None} - if 'cpp' in self.flags and self.enabled and not (self.is_virtual_source() or self.is_virtual_sink()): - self.orig_cpp_templates = self.cpp_templates # The original template, in case we have to edit it when transpiling to C++ + if Flags.HAS_CPP in self.flags and self.enabled and not (self.is_virtual_source() or self.is_virtual_sink()): + # This is a workaround to allow embedded python blocks/modules to load as there is + # currently 'cpp' in the flags by default caused by the other built-in blocks + if hasattr(self,'cpp_templates'): + self.orig_cpp_templates = self.cpp_templates # The original template, in case we have to edit it when transpiling to C++ self.current_bus_structure = {'source': None, 'sink': None} |