def tryall(context, prefix=None):
 context = context.copy()
 results = {}
 for (k, v) in context.iteritems():
  if (not hasattr(v, '__call__')):
   continue
  if (prefix and (not k.startswith(prefix))):
   continue
  print (k + ':'),
  try:
   r = v()
   dictincr(results, r)
   print r
  except:
   print 'ERROR'
   dictincr(results, 'ERROR')
   print ('   ' + '\n   '.join(traceback.format_exc().split('\n')))
 print ('-' * 40)
 print 'results:'
 for (k, v) in results.iteritems():
  print (' ' * 2), (str(k) + ':'), v

def tryall ( context , prefix = None ) : context = context . copy ( ) results = { } for ( k , v ) in context . iteritems ( ) : if ( not hasattr ( v , '__call__' ) ) : continue if ( prefix and ( not k . startswith ( prefix ) ) ) : continue print ( k + ':' ) , try : r = v ( ) dictincr ( results , r ) print r except : print 'ERROR' dictincr ( results , 'ERROR' ) print ( '   ' + '\n   ' . join ( traceback . format_exc ( ) . split ( '\n' ) ) ) print ( '-' * 40 ) print 'results:' for ( k , v ) in results . iteritems ( ) : print ( ' ' * 2 ) , ( str ( k ) + ':' ) , v
tries a series of functions and prints their results .