def spewer(frame, s, ignored):
 from twisted.python import reflect
 if frame.f_locals.has_key('self'):
  se = frame.f_locals['self']
  if hasattr(se, '__class__'):
   k = reflect.qual(se.__class__)
  else:
   k = reflect.qual(type(se))
  print ('method %s of %s at %s' % (frame.f_code.co_name, k, id(se)))
 else:
  print ('function %s in %s, line %s' % (frame.f_code.co_name, frame.f_code.co_filename, frame.f_lineno))

def spewer ( frame , s , ignored ) : from twisted . python import reflect if frame . f_locals . has_key ( 'self' ) : se = frame . f_locals [ 'self' ] if hasattr ( se , '__class__' ) : k = reflect . qual ( se . __class__ ) else : k = reflect . qual ( type ( se ) ) print ( 'method %s of %s at %s' % ( frame . f_code . co_name , k , id ( se ) ) ) else : print ( 'function %s in %s, line %s' % ( frame . f_code . co_name , frame . f_code . co_filename , frame . f_lineno ) )
a trace function for sys .