def enable_trace(case, trace_exclusions=None, f=sys.stdout):
 if (trace_exclusions is None):
  trace_exclusions = ['twisted', 'worker_transition.py', 'util/tu', 'log.py', '/mq/', '/db/', 'buildbot/data/', 'fake/reactor.py']
 bbbase = os.path.dirname(buildbot.__file__)
 state = {'indent': 0}
 def tracefunc(frame, event, arg):
  if frame.f_code.co_filename.startswith(bbbase):
   if (not any(((te in frame.f_code.co_filename) for te in trace_exclusions))):
    if (event == 'call'):
     state['indent'] += 2
     print(('-' * state['indent']), frame.f_code.co_filename.replace(bbbase, ''), frame.f_code.co_name, frame.f_code.co_varnames, file=f)
    if (event == 'return'):
     state['indent'] -= 2
  return tracefunc
 sys.settrace(tracefunc)
 case.addCleanup(sys.settrace, (lambda _a, _b, _c: None))

def enable_trace ( case , trace_exclusions = None , f = sys . stdout ) : if ( trace_exclusions is None ) : trace_exclusions = [ 'twisted' , 'worker_transition.py' , 'util/tu' , 'log.py' , '/mq/' , '/db/' , 'buildbot/data/' , 'fake/reactor.py' ] bbbase = os . path . dirname ( buildbot . __file__ ) state = { 'indent' : 0 } def tracefunc ( frame , event , arg ) : if frame . f_code . co_filename . startswith ( bbbase ) : if ( not any ( ( ( te in frame . f_code . co_filename ) for te in trace_exclusions ) ) ) : if ( event == 'call' ) : state [ 'indent' ] += 2 print ( ( '-' * state [ 'indent' ] ) , frame . f_code . co_filename . replace ( bbbase , '' ) , frame . f_code . co_name , frame . f_code . co_varnames , file = f ) if ( event == 'return' ) : state [ 'indent' ] -= 2 return tracefunc sys . settrace ( tracefunc ) case . addCleanup ( sys . settrace , ( lambda _a , _b , _c : None ) )
enable tracing of app instances .