From 21e9052402b73058c074ea5f334a06d34bf9ee37 Mon Sep 17 00:00:00 2001 From: "Maurice (mausy5043) Hendrix" Date: Thu, 17 Oct 2024 17:38:07 +0200 Subject: [PATCH] fix use of globals --- bin/trend.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/trend.py b/bin/trend.py index 4158213..e53c59a 100755 --- a/bin/trend.py +++ b/bin/trend.py @@ -61,10 +61,7 @@ def prune(objects): def fetch_data(hours_to_fetch=48, aggregation="10min"): - global EDATETIME # pylint: disable=W0603 - if OPTION.edate: - print("NOT NOW") - EDATETIME = f"'{OPTION.edate}'" + """...""" data_dict_rht = fetch_data_rht(hours_to_fetch=hours_to_fetch, aggregation=aggregation) data_dict_ac = fetch_data_ac(hours_to_fetch=hours_to_fetch, aggregation=aggregation) data_dict = {} @@ -410,6 +407,9 @@ def main(): if OPTION.devlist: OPTION.devlist = json.loads(OPTION.devlist) DEVICE_LIST = prune(DEVICE_LIST) + if OPTION.edate: + print("NOT NOW") + EDATETIME = f"'{OPTION.edate}'" if OPTION.debug: print(OPTION) main()