Module iof
[hide private]
[frames] | no frames]

Module iof

source code

IO functions.

Functions [hide private]
 
z_u(a, enc=None)
Convert a to unicode if a is not unicode.
source code
None
log(*arg)
Print all concatenated z_u(arg) if cfg.PYBAG_LOG True.
source code
None
dbg(*arg)
Print all concatenated z_u(arg) if cfg.PYBAG_DEBUG True.
source code
None
log_writeln(*arg)
Main writeln function for logging.
source code
None
log_writeln_1(*arg)
Main writeln function for logging.
source code
 
log_writeln_0(*arg)
Used if log_init was fail in log_writeln and do nothing.
source code
 
log_init()
Initialize file output stream.
source code
 
log_clear()
Do clean up for fstream: close if need.
source code
 
prt(*arg, **kwd)
Print all arg consecutively with print builtin function.
source code
 
prt0(*arg, **kwd)
Print arguments arg with prt with verbose = 0.
source code
 
prt1(*arg, **kwd)
Print arguments arg with prt with verbose = 1.
source code
 
prt2(*arg, **kwd)
Print arguments arg with prt with verbose = 2.
source code
 
prt3(*arg, **kwd)
Print arguments arg with prt with verbose = 3.
source code
 
prt4(*arg, **kwd)
Print arguments arg with prt with verbose = 4.
source code
 
prt5(*arg, **kwd)
Print arguments arg with prt with verbose = 5.
source code
 
init_encoding()
Get system enconings.
source code
Variables [hide private]
  _loglock = threading.Lock()
Lock object for threading output.
  __package__ = None

Imports: sys, codecs, locale, traceback, os, threading, cfg


Function Details [hide private]

z_u(a, enc=None)

source code 

Convert a to unicode if a is not unicode. Use default locale encoding if not given enc.

log(*arg)

source code 

Print all concatenated z_u(arg) if cfg.PYBAG_LOG True.

Parameters:
  • arg (*object) - Object to output. All objects convert to string str() function.
Returns: None
None.

dbg(*arg)

source code 

Print all concatenated z_u(arg) if cfg.PYBAG_DEBUG True.

Parameters:
  • arg (*object) - Object to output. All objects convert to string str() function.
Returns: None
None.

log_writeln(*arg)

source code 

Main writeln function for logging. Write concatenated arguments into outstream and append new line ('\n').

Parameters:
  • arg (*object) - Object to output. All objects convert to string z_u() function.
Returns: None
None.

log_writeln_1(*arg)

source code 

Main writeln function for logging. Write concatenated arguments into outstream and append new line ('\n').

Parameters:
  • arg (*object) - Object to output. All objects convert to string z_u() function.
Returns: None
None.

log_init()

source code 

Initialize file output stream.

Default is "pybag.log".

prt(*arg, **kwd)

source code 

Print all arg consecutively with print builtin function. Also log all output.

Parameters:
  • verbose - Verbosity level. {default VERBOSE == 3}.
  • place - Function name from called print.
  • error - Error description or exception.