Module io :: Class IO
[hide private]
[frames] | no frames]

Class IO

source code

Instance Methods [hide private]
 
__init__(self, relax)
Class containing the file operations.
source code
 
delete(self, file_name=None, dir=None)
Function for deleting the given file.
source code
 
extract_data(self, file_name=None, dir=None, file_data=None, sep=None, compress_type=0)
Open the file 'file' and return all the data.
source code
 
file_path(self, file_name=None, dir=None)
Generate and expand the full file path.
source code
 
log(self, file_name=None, dir=None, compress_type=0, print_flag=1)
Function for turning logging on.
source code
 
logging_off(self, file_name=None, dir=None, print_flag=1)
Function for turning logging and teeing off.
source code
 
mkdir(self, dir=None, print_flag=1)
Create the given directory, or exit if the directory exists.
source code
 
open_read_file(self, file_name=None, dir=None, compress_type=0, print_flag=1)
Open the file 'file' and return all the data.
source code
 
open_write_file(self, file_name=None, dir=None, force=0, compress_type=0, print_flag=1, return_path=0)
Function for opening a file for writing and creating directories if necessary.
source code
 
strip(self, data)
Function to remove all comment and empty lines from the file data structure.
source code
 
tee(self, file_name=None, dir=None, compress_type=0, print_flag=1)
Function for turning logging on.
source code
 
test_binary(self, binary)
Function for testing that the binary string corresponds to a valid executable file.
source code
Method Details [hide private]

__init__(self, relax)
(Constructor)

source code 
Class containing the file operations.

IO streams
~~~~~~~~~~

Standard python IO streams:

sys.stdin  = self.python_stdin
sys.stdout = self.python_stdout
sys.stderr = self.python_stderr

Logging IO streams:

sys.stdin  = self.log_stdin  = self.python_stdin
sys.stdout = self.log_stdout = self.log_file
sys.stderr = self.log_stdout = (self.python_stderr, self.log_file)

Tee IO streams:

sys.stdin  = self.tee_stdin  = self.python_stdin
sys.stdout = self.tee_stdout = (self.python_stdout, self.tee_file)
sys.stderr = self.tee_stdout = (self.python_stderr, self.tee_file)