1 from pyaspects.weaver import weave_class_method
3 from PLC.Method import Method
4 from aspects.omfaspects import OMFAspect
5 from aspects.ratelimitaspects import RateLimitAspect
7 def apply_omf_aspect():
8 # track all PLC methods to add OMF hooks
9 weave_class_method(OMFAspect(), Method, "__call__")
11 def apply_ratelimit_aspect():
12 weave_class_method(RateLimitAspect(), Method, "__call__")
14 def apply_debugger_aspect():
15 # just log all method calls w/ their parameters
16 from pyaspects.debuggeraspect import DebuggerAspect
17 weave_class_method(DebuggerAspect(out=open("/tmp/all_method_calls.log", "a")), Method, "__call__")