git://git.onelab.eu
/
plcapi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
startup scripts : assume initscripts is not installed, only use systemctl
[plcapi.git]
/
aspects
/
__init__.py
diff --git
a/aspects/__init__.py
b/aspects/__init__.py
index
bcce3bc
..
41cbe77
100644
(file)
--- a/
aspects/__init__.py
+++ b/
aspects/__init__.py
@@
-1,16
+1,14
@@
-
-
from pyaspects.weaver import weave_class_method
from PLC.Method import Method
from pyaspects.weaver import weave_class_method
from PLC.Method import Method
-from aspects.
omfaspects import OMF
Aspect
+from aspects.
ratelimitaspects import RateLimit
Aspect
+def apply_ratelimit_aspect():
+ weave_class_method(RateLimitAspect(), Method, "__call__")
-def apply_aspects():
+def apply_debugger_aspect():
+ # just log all method calls w/ their parameters
+ from pyaspects.debuggeraspect import DebuggerAspect
+ weave_class_method(DebuggerAspect(out=open("/tmp/all_method_calls.log", "a")), Method, "__call__")
- # TEST
- #from pyaspects.debuggeraspect import DebuggerAspect
- #weave_class_method(DebuggerAspect(out=open("/tmp/all_method_calls.log", "a")), Method, "__call__")
- # track all PLC methods to add OMF hooks
- weave_class_method(OMFAspect(), Method, "__call__")