projects
/
kiosk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Towards mypy cleanliness.
[kiosk.git]
/
decorators.py
diff --git
a/decorators.py
b/decorators.py
index 7a088796a9cce63616412a8cbfccf16c2f8bb2fa..ba2e53d4b594a27f21a06a77ca8242b92c2e8b9b 100644
(file)
--- a/
decorators.py
+++ b/
decorators.py
@@
-1,7
+1,10
@@
+#!/usr/bin/env python3
+
from datetime import datetime
import functools
from datetime import datetime
import functools
-def invokation_logged(func):
+
+def invocation_logged(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
now = datetime.now()
@functools.wraps(func)
def wrapper(*args, **kwargs):
now = datetime.now()
@@
-12,13
+15,15
@@
def invokation_logged(func):
timestamp = now.strftime("%d-%b-%Y (%H:%M:%S.%f)")
print("%s(%s): Exited function" % (func.__name__, timestamp))
return ret
timestamp = now.strftime("%d-%b-%Y (%H:%M:%S.%f)")
print("%s(%s): Exited function" % (func.__name__, timestamp))
return ret
+
return wrapper
return wrapper
+
# Test
# Test
-#
@invok
ation_logged
-#def f(x):
+#
@invoc
ation_logged
+#
def f(x):
# print(x * x)
# return x * x
#
# print(x * x)
# return x * x
#
-#q = f(10)
-#print(q)
+#
q = f(10)
+#
print(q)