|
Methods defined here:
- __del__(self)
- deletion method of FilterFile.
This method closes a file if a file was opened
- __init__(self, filename=None, opennow=False, mode='r', replace_ext='bak')
- constructor of a FilterFile. Arguments:
parameters:
filename -- the filename or None in order
to open stdin or stdout
default: None
opennow -- if True, open the file just after
object creation. default: False
mode -- the filemode as it is described for
the python open() function.
when filename is None, mode "r" opens
stdin, mode "w" or mode "u" opens
stdout. A special case is mode "u",
with python open() doesn't know of.
When filename is not None, mode "u"
opens a temporary-file that is
renamed to the original file upon
close. The original file is renamed
to filename.<replace_ext>.
replace_ext -- the filename-extension for the backup
of the original file when "u" is
used for the mode parameter.
- close(self)
- close the file.
If standard-in or standard-out were actually selected,
they are not closed.
- fh(self)
- return the filehandle of the currently opened file.
- open(self)
- open the file.
If the filename is None, standard-in or standard-out
are not actually opened but only their filehandles
are stored within the FilterFile object.
- print_to_screen(self)
- print the contents of the file to the screen.
This function prints the contents of the currently
in read-mode opened file to standard-out.
Note that it raises an exception of there is no
file open or if the mode is not "r".
- read(self, *args)
- read from the currently opened file.
This method simply calls self.fh().read(args).
- readline(self, *args)
- read a line from the currently opened file.
This method simply calls self.fh().readline(args).
- write(self, *args)
- write to the currently opened file.
This method simply calls self.fh().write(args).
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|