Commit 06c5fb30 authored by payno's avatar payno

Merge branch 'master' of gitlab.esrf.fr:workflow/representation

parents 7b582358 ac97541e
......@@ -52,7 +52,7 @@ def trace_unhandled_exceptions(func):
@functools.wraps(func)
def wrapped_func(*args, **kwargs):
try:
outData = func(*args, **kwargs)
out_data = func(*args, **kwargs)
except Exception as e:
_logger.exception(e)
errorMessage = '{0}'.format(e)
......@@ -62,7 +62,7 @@ def trace_unhandled_exceptions(func):
traceBack=traceBack,
data=args[1]
)
return outData
return out_data
return wrapped_func
......@@ -111,7 +111,7 @@ class Node(object):
self._output_type_to_name = {}
"""link output type to a signal name"""
self._error_handler = error_handler
self.outData = None
self.out_data = None
def get_input_channel_name(self, data_object):
for dtype, channel_name in self._input_type_to_name.items():
......@@ -133,6 +133,10 @@ class Node(object):
def process_pt(self):
return self._process_pt
@property
def class_instance(self):
return self.__process_instance
def isfinal(self) -> bool:
"""
......@@ -202,6 +206,7 @@ class Node(object):
'same input type. This case is not managed.')
self._input_type_to_name[input_type] = input_name
self._handlers[input_name] = input_handler
# self._handlers[input_name] = getattr(self.__process_instance, input_handler)
if hasattr(self.__process_instance, 'outputs'):
for output_ in self.__process_instance.outputs:
output_name, output_type, output_handler = output_[:3]
......@@ -352,4 +357,4 @@ class ErrorHandler(Node):
error_handler=None)
def _get_error_handler_json(self):
return {}
\ No newline at end of file
return {}
......@@ -154,7 +154,7 @@ class Scheme(object):
"""
:return: list of nodes starting the workflow. Those does not require
any input_data
any input_data.
:rtype: list
"""
res = []
......@@ -302,9 +302,10 @@ class Scheme(object):
:param str json_file_path: path to the json file containing the scheme
description
:return: Scheme fitting the json description contains if the file.
If description is incomplete, return None
:rtype:Union[Scheme,None]
:rtype: Union[Scheme, None]
"""
try:
with open(json_file_path, 'r') as json_file:
......@@ -378,7 +379,7 @@ class Scheme(object):
def scheme_to_etree(self, data_format:str = "literal",
pickle_fallback: bool = False):
"""
Return an `xml.etree.ElementTree` representation of the `scheme.
Return an 'xml.etree.ElementTree' representation of the scheme.
"""
builder = TreeBuilder(element_factory=Element)
builder.start("scheme", {"version": "2.0",
......@@ -562,9 +563,10 @@ class SubScheme(Scheme, Node):
def load_from_json(json_data: dict):
"""
:param json_data: scheme description
:param json_data: scheme description.
:raise ValueError: if sink or source channel missing or if link id
missing or if sink or source node missing
missing or if sink or source node missing.
"""
nodes, links, sub_schemes, title, description = Scheme.load_scheme_info_from_json(json_data)
_id, _properties, _process_pt = Node.load_node_info_from_json(json_data)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment