Skip to content

Commit 3299945

Browse files
committed
python: second attempt at fixing propagate labels
* resolve the input to a name for the helper (this fixes registry issues) * return if the propagate labels was implemented (and call the base implementation if not)
1 parent 280fd34 commit 3299945

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

Pothos/Block.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def deactivate(self): pass
5151

5252
def work(self): pass
5353

54-
def propagateLabels(self, input): pass
54+
def propagateLabels(self, input): return NotImplemented
5555

56-
def _propagateLabels(self, input):
57-
self.propagateLabels(InputPort(input))
56+
def _propagateLabels(self, name):
57+
return self.propagateLabels(self.input(name)) is NotImplemented

PythonBlock.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,11 @@ class PythonBlock : Pothos::Block
4040

4141
void propagateLabels(const Pothos::InputPort *input)
4242
{
43-
//forward to wrapper that casts input object
44-
_block.call("_propagateLabels", input);
43+
//forward to wrapper that takes input port name
44+
auto not_implemeneted = _block.call<bool>("_propagateLabels", input->name());
45+
46+
//if the overload was not implemented, call base function
47+
if (not_implemeneted) Pothos::Block::propagateLabels(input);
4548
}
4649

4750
Pothos::Object opaqueCallHandler(const std::string &name, const Pothos::Object *inputArgs, const size_t numArgs)

0 commit comments

Comments
 (0)