#NEWLINE# def trackstacklist( stack = None , limit = None ) : #NEWLINE# #INDENT# if ( stack is None ) : #NEWLINE# #INDENT# stack = JS ( '$pyjs.__active_exception_stack__' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if JS ( '@{{stack}} instanceof Array' ) : #NEWLINE# #INDENT# stack = _exception_from_trackstack ( stack ) #NEWLINE# #UNINDENT# #UNINDENT# if ( stack is None ) : #NEWLINE# #INDENT# return '' #NEWLINE# #UNINDENT# stackstrings = [ ] #NEWLINE# msg = '' #NEWLINE# if ( limit is None ) : #NEWLINE# #INDENT# limit = ( - 1 ) #NEWLINE# #UNINDENT# while ( stack and limit ) : #NEWLINE# #INDENT# JS ( "@{{msg}} = $pyjs.loaded_modules[@{{stack}}.module]['__track_lines__'][@{{stack}}['lineno']];" ) #NEWLINE# JS ( "if (typeof @{{msg}} == 'undefined') @{{msg}} = null;" ) #NEWLINE# if msg : #NEWLINE# #INDENT# stackstrings . append ( ( msg + '\n' ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# stackstrings . append ( ( '%s.py, line %d\n' % ( stack . module , msg . lineno ) ) ) #NEWLINE# #UNINDENT# stack = stack . tb_next #NEWLINE# limit -= 1 #NEWLINE# #UNINDENT# return stackstrings