currently, the code is too verbose when using Action:
def _setup_watchdog(self): self._action = Action('Setup Watchdog') try: ... finally: self._end_action()
Using a simple decorator like this one:
def action(doing): @wrapt.decorator def wrapper(wrapped, instance, args, kwargs): Action(doing) try: yield wrapped(*args, **kwargs) finally: Action.finish_action() return wrapper
Is better and easier to use:
@action('Setup Watchdog') def _setup_watchdog(self): ...