From 075cde20b4dbc9e43924a5b469a6bf3ddeb48d38 Mon Sep 17 00:00:00 2001 From: neodarz Date: Sun, 26 May 2019 12:44:46 +0200 Subject: Move static_vars function to external file --- utils/utils.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'utils') diff --git a/utils/utils.py b/utils/utils.py index 1cabbdc8..44cf8e59 100644 --- a/utils/utils.py +++ b/utils/utils.py @@ -193,3 +193,11 @@ def postprocess_html_file(htmlfilepath): htmlfileobj.seek(0) htmlfileobj.write(str(soup)) htmlfileobj.truncate() + + +def static_vars(**kwargs): + def decorate(func): + for k in kwargs: + setattr(func, k, kwargs[k]) + return func + return decorate -- cgit v1.2.1