ProcessOutputReader

class ase2sprkkr.outputs.test.process_output_reader.ProcessOutputReader[source]

Class, that run a process, optionally saves all the output of the process to a file, and pass the stdout and stderr of the process to its two async routines, read_error and read_output.

The descendant can redefine the routines to parse the output (or its parts).

Class hierarchy

Inheritance diagram of ase2sprkkr.outputs.test.process_output_reader.ProcessOutputReader

Constructor

__init__()
async run_subprocess(read_args=[])[source]
result(output, error, wait)[source]

This function is for postprocessing the results.

It is intended to be predefined in the descendants

Parameters:
  • output (mixed) – Result of the self.read_output

  • error (mixed) – Result of the self.read_error

  • wait (int) – The process return value

Returns:

out – Currently, the tuple (output, error, return_code) is returned, however, subclasses can return anything they want.

Return type:

mixed

run(cmd, outfile, read_args=[], print_output=False, directory=None, **kwargs)[source]
async read_error(stderr, *args)[source]
async read_output(stdout, *args)[source]
result_from_file(cls, output, error=None, read_args=[], return_code=0, print_output=False)[source]
read_from_file(cls, output, error=None, read_args=[], return_code=0, print_output=False)[source]

Read the data from file.