Biskit :: LogFile :: LogFile :: Class LogFile
[hide private]
[frames] | no frames]

Class LogFile

source code


Simple log file that can be passed between objects. It is flushed after each writing and should hence always be up2date.

Instance Methods [hide private]
  __init__(self, fname, mode='w')
object f(self)
Open file only when needed for first time.
  write(self, s)
Synonym for add_nobreak.
  writeln(self, s)
Synonym for add.
  add(self, s)
Add new line to logfile and flush
  add_nobreak(self, s)
Add new line without creating a linebreak to logfile and flush
  __del__(self)
Close file handle.

Method Details [hide private]

__init__(self, fname, mode='w')
(Constructor)

source code 
Parameters:
  • fname (str) - name of log file
  • mode (str) - mode (default: w)

f(self)

source code 

Open file only when needed for first time.
Returns: object
open file handle

write(self, s)

source code 

Synonym for add_nobreak.
Parameters:
  • s (str) - line

writeln(self, s)

source code 

Synonym for add.
Parameters:
  • s (str) - line

add(self, s)

source code 

Add new line to logfile and flush
Parameters:
  • s (str) - line

add_nobreak(self, s)

source code 

Add new line without creating a linebreak to logfile and flush
Parameters:
  • s (str) - line

__del__(self)
(Destructor)

source code 

Close file handle.