add @oneshot decorator

This commit is contained in:
jan 2023-04-07 16:33:23 -07:00
commit 46a7f60460

View file

@ -30,3 +30,10 @@ class PortError(MasqueError):
Exception raised by builder-related functions
"""
pass
class OneShotError(MasqueError):
"""
Exception raised when a function decorated with `@oneshot` is called more than once
"""
def __init__(self, func_name: str) -> None:
Exception.__init__(self, f'Function "{func_name}" with @oneshot was called more than once')