Commit 1e06fcef authored by Mathias Lüdtke's avatar Mathias Lüdtke Committed by oroulet

handle tuple and None in uamethod decorator

parent abcd84b7
...@@ -60,12 +60,17 @@ def uamethod(func): ...@@ -60,12 +60,17 @@ def uamethod(func):
parent = args[0] parent = args[0]
args = args[1:] args = args[1:]
result = func(self, parent, *[arg.Value for arg in args]) result = func(self, parent, *[arg.Value for arg in args])
if isinstance(result, ua.CallMethodResult): if result is None:
return []
elif isinstance(result, ua.CallMethodResult):
result.OutputArguments = to_variant(*result.OutputArguments) result.OutputArguments = to_variant(*result.OutputArguments)
return result return result
elif isinstance(result, ua.StatusCode): elif isinstance(result, ua.StatusCode):
return result return result
return to_variant(result) elif isinstance(result, tuple):
return to_variant(*result)
else:
return to_variant(result)
return wrapper return wrapper
......
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