|
@@ -19,10 +19,6 @@ class DefaultCallCatcher(object):
|
19
|
19
|
# @throw AttributeError if the attr does not exist
|
20
|
20
|
@classmethod
|
21
|
21
|
def attr_get(self, obj, attr_name):
|
22
|
|
- if hasattr(obj, '__name__'):
|
23
|
|
- print("\tCatched ! %s.%s" % (obj.__name__, attr_name))
|
24
|
|
- else:
|
25
|
|
- print("\tCatched ! Get %s.%s" % (obj, attr_name))
|
26
|
22
|
return getattr(obj, attr_name)
|
27
|
23
|
|
28
|
24
|
## @brief Method designed to be called when a wrapped class method is called
|
|
@@ -34,14 +30,6 @@ class DefaultCallCatcher(object):
|
34
|
30
|
# @return the call returned value
|
35
|
31
|
@classmethod
|
36
|
32
|
def method_call(cls, obj, method, args, kwargs):
|
37
|
|
- if obj is method:
|
38
|
|
- print("\tCatched ! %s(%s %s)" % (obj.__name__, args, kwargs))
|
39
|
|
- else:
|
40
|
|
- if hasattr(obj, '__name__'):
|
41
|
|
- print("\tCatched ! %s.%s(%s %s)" % (obj.__name__, method.__name__, args,kwargs))
|
42
|
|
- else:
|
43
|
|
- print("\tCatched ! %s.%s(%s %s)" % (obj, method.__name__, args,kwargs))
|
44
|
|
- print("\t\tCallobject = %s method = %s with %s %s" % (obj, method, args, kwargs))
|
45
|
33
|
return cls.__do_call__(method, args, kwargs)
|
46
|
34
|
|
47
|
35
|
## @brief Do the method call
|