Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Oct 19th, 2012  |  syntax: Python  |  size: 0.29 KB  |  hits: 7  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. result = func(*args, **kwargs)
  2. if self.catch_returns or self.log_returns:
  3.         if isinstance(result, dict):
  4.                 self.returned(result)
  5.         elif inspect.isgenerator(result) or 'itertools' in str(result.__class__):
  6.                 for x in result:
  7.                         self.returned(x)
  8.                         time.sleep(0.1)
  9.         else:
  10.                 self.returned(result)