make all *View classes call their parent constructors.
[matthijs/upstream/mobilegtd.git] / src / log / traceS60.py
1 import sys
2 import linecache
3 from e32 import ao_sleep
4 refresh=lambda:ao_sleep(0)
5
6 class trace:        
7   def __init__(self,f_all=u'c:\\traceit.txt',f_main=u'c:\\traceitmain.txt'):
8       self.out_all=open(f_all,'w')
9       self.out_main=open(f_main,'w')
10       
11   def go(self):    
12       sys.settrace(self.traceit)
13       
14   def stop(self):    
15       sys.settrace(None)
16       self.out_all.close()
17       self.out_main.close()
18
19   def traceit(self,frame, event, arg):
20         lineno = frame.f_lineno
21         name = frame.f_globals["__name__"]
22         file_trace=frame.f_globals["__file__"]
23         line=linecache.getline(file_trace,lineno)
24
25         self.out_all.write("%s*%s*of %s(%s)\n*%s*\n" %(event,lineno,name,file_trace,line.rstrip()))
26         refresh()
27         return self.traceit
28
29
30