From 9e5b9b5fd355a5e05ac7d37d5c7c4cc2eda13c96 Mon Sep 17 00:00:00 2001 From: Alexandre Gobbo Date: Wed, 4 Sep 2019 15:18:03 +0200 Subject: [PATCH] Closedown --- script/Decorator.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/script/Decorator.py b/script/Decorator.py index 473ada4..dce066e 100644 --- a/script/Decorator.py +++ b/script/Decorator.py @@ -1,11 +1,18 @@ -SCAN_INDEX = 1 + + +def get_scan_index(): + try: + return int(get_setting("ScanIndex") + except: + return 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 + index = get_scan_index(): + set_exec_pars(name=str(index)) + set_setting("ScanIndex", index+1) func(scan, pars) return wrapper