/usr/share/pyshared/Misc/traced.py is in eficas 2.0.3-1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | indent = 0
indStr = ' '
def srepr(*argl,**argd):
#parse the arguments and create a string representation
args = []
for item in argl:
args.append('%s' % str(item))
for key,item in argd.items():
args.append('%s=%s' % (key,str(item)))
argstr = ','.join(args)
return argstr
def logfunc(f):
def _method(*argl,**argd):
global indent
print indStr*indent+f.__module__+"."+f.__name__+"("+srepr(*argl,**argd)+")"
indent += 1
r=f(*argl,**argd)
indent -= 1
print indStr*indent+str(r)
return r
return _method
def logmeth(f):
def _method(self,*argl,**argd):
global indent
print indStr*indent+str(self)+"."+f.__name__+"("+srepr(*argl,**argd)+")"
indent += 1
r=f(self,*argl,**argd)
indent -= 1
print indStr*indent+str(r)
return r
return _method
if __name__ == "__main__":
@logfunc
def g(a,b):
return a
class A:
@logmeth
def h(self,a):
return g(a,a)
g(1,2)
a=A()
a.h(1)
|