I'm trying to build an interactive IDE...
the IDE has a file testing interface which displays a tree of the called functions in relation to the data in the file being tested.
what I want to do is when you select a function referenced in the tree, it'll highlight that function in the code.
I'm currently using this to get the line number:
import inspect as _insp
def trace(func):
def inner():
f = _insp.currentframe().f_back
#mod = f.f_code.co_filename
print 'You called %s at [ %d, %d ]' % (func.__name__, f.f_lineno, 0)
return func()
return inner
^ that 0 is a placeholder for the column number...
I'm using the trace function as a decorator:
from API.externals import trace
@trace
def ugeSetBone(): return
here's the tested results:
>>> from API.backend.FORMAT._rig import *
>>> t = ugeSetBone()
You called ugeSetBone at [ 1, 0 ]
what I'm hoping for is the return string to be:
'You called ugeSetBone at [ 1, 4 ]'
I'm expecting this to work in manners as such:
t,t2 = ugeSetBone(),ugeSetBone()
results being:
'You called ugeSetBone at [ 1, 8 ]'
'You called ugeSetBone at [ 1, 21 ]'
thanks :)