aboutsummaryrefslogtreecommitdiffstats
path: root/decorators.py
diff options
context:
space:
mode:
authorPinapelz <donaldshan1@outlook.com>2023-06-20 02:14:34 -0700
committerPinapelz <donaldshan1@outlook.com>2023-06-20 02:14:34 -0700
commit70237b5a5d82e8425eb5870a975bde497a6def08 (patch)
tree6930d7ae771fb188fc6a3a0f7f1f81bad5bf84f2 /decorators.py
parentc929c11f9006db67e10ddd7fa599124a6edeadeb (diff)
Refactored entire codebase
- Replaced most code with HTML templates - Fixed some janky SQL queries - Replaced config.py with ini and json
Diffstat (limited to 'decorators.py')
-rw-r--r--decorators.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/decorators.py b/decorators.py
new file mode 100644
index 0000000..bc0b420
--- /dev/null
+++ b/decorators.py
@@ -0,0 +1,16 @@
+import time
+
+
+def log(message: str):
+ def decorator(func):
+ def wrapper(*args, **kwargs):
+ print("TASK: " + message)
+ start = time.time()
+ result = func(*args, **kwargs)
+ end = time.time()
+ print(f"COMPLETE: {message} {round(end - start, 3)} seconds")
+ return result
+
+ return wrapper
+
+ return decorator
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage