Package prompt :: Module results :: Class Results
[hide private]
[frames] | no frames]

Class Results

source code


Class for manipulating results.

Instance Methods [hide private]
 
display(self)
Display the results.
source code
 
read(self, file='results', dir=None)
Read results from a file.
source code
 
write(self, file='results', dir='pipe_name', compress_type=1, force=False)
Write the results to a file.
source code

Inherited from base_class.User_fn_class: __init__

Method Details [hide private]

display(self)

source code 
Display the results.

Description
~~~~~~~~~~~

This will print to screen (STDOUT) the results contained within the current data pipe.

read(self, file='results', dir=None)

source code 
Read results from a file.

Keyword Arguments
~~~~~~~~~~~~~~~~~

file:  The name of the file to read results from.

dir:  The directory where the file is located.


Description
~~~~~~~~~~~

This function is able to handle uncompressed, bzip2 compressed files, or gzip compressed files
automatically.  The full file name including extension can be supplied, however, if the file cannot
be found the file with '.bz2' appended followed by the file name with '.gz' appended will be
searched for.

write(self, file='results', dir='pipe_name', compress_type=1, force=False)

source code 
Write the results to a file.

Keyword Arguments
~~~~~~~~~~~~~~~~~

file:  The name of the file to output results to.  The default is 'results'.  Optionally this can be
a file object, or any object with a write() method.

dir:  The directory name.

compress_type:  The type of compression to use when creating the file.

force:  A flag which if True will cause the results file to be overwritten.


Description
~~~~~~~~~~~

To place the results file in the current working directory in the prompt and scripting modes, set
dir to None.  If dir is set to the special name 'pipe_name', then the results file will be placed
into a directory with the same name as the current data pipe.

The default behaviour of this function is to compress the file using bzip2 compression.  If the
extension '.bz2' is not included in the file name, it will be added.  The compression can, however,
be changed to either no compression or gzip compression.  This is controlled by the compression type
which can be set to

    0:  No compression (no file extension),
    1:  bzip2 compression ('.bz2' file extension),
    2:  gzip compression ('.gz' file extension).

The complementary read function will automatically handle the compressed files.