Commits (2)
......@@ -166,6 +166,7 @@ class Node(object):
self._handlers.clear()
self._input_type_to_name.clear()
self._output_type_to_name.clear()
assert self._process_pt is not None
if callable(self._process_pt):
self.__process_instance = self._process_pt
......@@ -245,13 +246,17 @@ class Node(object):
''.format(str(process_pt), input_data, input_name))
if hasattr(node.__process_instance, 'set_properties'):
node.__process_instance.set_properties(properties)
else:
raise ValueError('no function set properties found')
if input_name in node.handlers:
out = getattr(node.__process_instance, node.handlers[input_name])(input_data)
if type(node.handlers[input_name]) is str:
out = getattr(node.__process_instance, node.handlers[input_name])(input_data)
else:
out = node.handlers[input_name](input_data)
elif None in node.handlers:
out = getattr(node.__process_instance, node.handlers[None])(input_data)
if type(node.handlers[None]) is str:
out = getattr(node.__process_instance, node.handlers[None])(input_data)
else:
out = node.__process_instance(input_data)
else:
err = '"{0}" channel is not managed by {1}'.format(input_name, node._process_pt)
raise KeyError(err)
......