A class to store data to a file
FileStorage constructor
Param: |
|
---|
FileStorage constructor
Param: |
|
---|
Methods
__init__([path, timestamp, name, overwrite, ...]) | FileStorage constructor |
log_error(error[, message]) | Logs the error in bold red |
Attributes
logger |
|
||
path | The path to prepend to files (cwd if not set by client) |
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 |
Adds a timestamp if formatted for it, increments if already exists
Param: |
|
---|---|
Returns: | unique name with full path |
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: |
|
---|
Returns: | A logging object. |
---|
The path to prepend to files (cwd if not set by client)
checks if the file is open for writing