Package orm2 :: Module debug :: Class _logstream
[hide private]
[frames] | no frames]

Class _logstream

source code

Known Subclasses:
_debug, _log, _sql

Implement a subset of the file interface to be used for status messages. Depending on its verbose flag, the write() method will pass its argument to sys.stderr.write() or discard it.

Instance Methods [hide private]
  __init__(self)
  write(self, s)
  flush(self)
  __call__(self, option, opt, value, parser)
Called by the Option Parser when the command line option added by the add_option method() implemented by the two child classes is present.
  __nonzero__(self)
Return true if logging is ON, otherwise return False.

Method Details [hide private]

__init__(self)
(Constructor)

source code 
None

write(self, s)

source code 
None

flush(self)

source code 
None

__call__(self, option, opt, value, parser)
(Call operator)

source code 
Called by the Option Parser when the command line option added by the add_option method() implemented by the two child classes is present.

__nonzero__(self)
(Boolean test operator)

source code 
Return true if logging is ON, otherwise return False. This is ment to be used in if clauses:
  if debug:
     print 'Debug!'