From 881526b84c56279f09b8e07b106c18a2333c39fb Mon Sep 17 00:00:00 2001 From: Alexandre Gobbo Date: Wed, 4 Sep 2019 15:12:59 +0200 Subject: [PATCH] Script execution --- script/Decorator.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 script/Decorator.py diff --git a/script/Decorator.py b/script/Decorator.py new file mode 100644 index 0000000..8f2d8d6 --- /dev/null +++ b/script/Decorator.py @@ -0,0 +1,15 @@ +SCAN_INDEX = 1 + +def processScanPars_decorator(func): + def wrapper(scan, pars): + global SCAN_INDEX + if 'name' not in pars: + set_exec_pars(name=str(SCAN_INDEX)) + SCAN_INDEX = SCAN_INDEX+1 + processScanPars(scan, pars) + return wrapper + +def say_whee(): + print("Whee!") + +processScanPars = processScanPars_decorator(processScanPars) \ No newline at end of file