Skip to content
Snippets Groups Projects
Commit 61e5c959 authored by Jan David Mol's avatar Jan David Mol
Browse files

Use () syntax behind wrappers for consistency with Tango/SKA wrappers

parent 1cc99173
No related branches found
No related tags found
1 merge request!7Resolve #2021 "03 16 branched from master elk stack"
...@@ -61,7 +61,7 @@ class hardware_device(Device): ...@@ -61,7 +61,7 @@ class hardware_device(Device):
self.value_dict = {i: i.initial_value() for i in self.attr_list()} self.value_dict = {i: i.initial_value() for i in self.attr_list()}
@log_exceptions @log_exceptions()
def init_device(self): def init_device(self):
""" Instantiates the device in the OFF state. """ """ Instantiates the device in the OFF state. """
...@@ -165,7 +165,7 @@ class hardware_device(Device): ...@@ -165,7 +165,7 @@ class hardware_device(Device):
"""Method always executed before any TANGO command is executed.""" """Method always executed before any TANGO command is executed."""
pass pass
@log_exceptions @log_exceptions()
def delete_device(self): def delete_device(self):
"""Hook to delete resources allocated in init_device. """Hook to delete resources allocated in init_device.
......
...@@ -54,9 +54,10 @@ def device_logging_to_python(log_extra: dict = None): ...@@ -54,9 +54,10 @@ def device_logging_to_python(log_extra: dict = None):
return inner return inner
def log_exceptions(func): def log_exceptions():
""" Decorator that logs all exceptions that the function raises. """ """ Decorator that logs all exceptions that the function raises. """
def wrapper(func):
@wraps(func) @wraps(func)
def inner(self, *args, **kwargs): def inner(self, *args, **kwargs):
try: try:
...@@ -66,3 +67,5 @@ def log_exceptions(func): ...@@ -66,3 +67,5 @@ def log_exceptions(func):
raise e raise e
return inner return inner
return wrapper
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment