Skip to content
Snippets Groups Projects
Commit 243d03da authored by Cyril Moineau's avatar Cyril Moineau
Browse files

Operator register now return an object instead of a function.

parent 13b26965
No related branches found
No related tags found
3 merge requests!279v0.4.0,!253v0.4.0,!163Export refactor
Checking pipeline status
...@@ -111,8 +111,9 @@ def operator_register(lib: ExportLib, key: str, *args): ...@@ -111,8 +111,9 @@ def operator_register(lib: ExportLib, key: str, *args):
"""Helper decorator to register an :py:class:`ExportNode` to an :py:class:`ExportLib` """Helper decorator to register an :py:class:`ExportNode` to an :py:class:`ExportLib`
""" """
def decorator(operator): def decorator(operator):
def wrapper(*args, **kwargs): class Wrapper(operator):
return operator(*args, **kwargs) def __init__(self, *args, **kwargs):
return operator(*args, **kwargs)
lib.add_export_node(key, operator) lib.add_export_node(key, operator)
return wrapper return Wrapper
return decorator return decorator
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment