forked from 0x2620/pandora
add line number too
This commit is contained in:
parent
1014bc8a89
commit
d718308453
1 changed files with 3 additions and 2 deletions
|
@ -99,8 +99,9 @@ class ApiActions(dict):
|
|||
f = self[name]
|
||||
if name != 'api' and hasattr(f, 'func_closure') and f.func_closure:
|
||||
f = f.func_closure[0].cell_contents
|
||||
filename = f.func_code.co_filename[len(settings.PROJECT_ROOT)+1:]
|
||||
return filename, trim(inspect.getsource(f))
|
||||
info = f.func_code.co_filename[len(settings.PROJECT_ROOT)+1:]
|
||||
info = u'%s:%s' % (info, f.func_code.co_firstlineno)
|
||||
return info, trim(inspect.getsource(f))
|
||||
|
||||
def register(self, method, action=None, cache=True):
|
||||
if not action:
|
||||
|
|
Loading…
Reference in a new issue