From 4659b16d5fbae26e0b3fb8c3609c3349ecd00f99 Mon Sep 17 00:00:00 2001 From: mwojcik Date: Thu, 12 Sep 2024 14:46:17 +0800 Subject: [PATCH] remove flags from python decorator definition --- nac3artiq/demo/min_artiq.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/nac3artiq/demo/min_artiq.py b/nac3artiq/demo/min_artiq.py index 27d6923b..3840a57a 100644 --- a/nac3artiq/demo/min_artiq.py +++ b/nac3artiq/demo/min_artiq.py @@ -112,14 +112,15 @@ def extern(function): register_function(function) return function -def rpc(function, flags={}): - """Decorates a function declaration defined by the core device runtime.""" - register_function(function) - @wraps(function) - def wrapped(function) - return function - wrapped.__artiq_rpc_flags__ = flags - return wrapped + +def rpc(arg=None, flags={}): + """Decorates a function or method to be executed on the host interpreter.""" + if arg is None: + def inner_decorator(function): + return rpc(function, flags) + return inner_decorator + register_function(arg) + return arg def kernel(function_or_method): """Decorates a function or method to be executed on the core device."""