A base-class based on file-objects
BaseStorage Constructor
BaseStorage Constructor
Methods
__init__() | BaseStorage Constructor |
close() | Closes self.file if it exists, sets self.closed to True |
log_error(error[, message]) | Logs the error in bold red |
open(name) | Opens a file for writing |
write(text[, exceptions]) | Writes the text to the file |
writeline(text) | Adds newline to end of text and writes it to the file |
writelines(texts[, exceptions]) | Writes the lines to the file |
Attributes
file | The open file object | ||
logger |
|
Closes self.file if it exists, sets self.closed to True
Logs the error in bold red
Param: |
|
---|
Opens a file for writing
Param: |
|
---|---|
Returns: | copy of self with file as open file and closed set to False |
Writes the text to the file
Param: |
|
---|---|
Raise: | ApeError if one of the exceptions is raised |
Adds newline to end of text and writes it to the file
Writes the lines to the file
Param: |
|
---|
The open file object
Returns: | A logging object. |
---|