fnp
/
wolnelektury.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
a68453d059d096d5627e9821bb994482e55418b7
[wolnelektury.git]
/
apps
/
wolnelektury_core
/
management
/
profile.py
1
2
import cProfile
3
import functools
4
5
_object = None
6
7
def profile(meth):
8
def _wrapper(self, *args, **kwargs):
9
object = self
10
setattr(object, "__%s" % meth.__name__, meth)
11
cProfile.runctx('object.__%s(object, *args, **kwargs)' % (meth.__name__, ), globals(), locals(),
12
"wlprofile")
13
14
functools.update_wrapper(_wrapper, meth)
15
return _wrapper
16