5.3. _command module

class capture_it._command.COMMAND(conn, cmd, path, parsed_output, visual_progress, logger_list)

Bases: object

CAPTURE OUTPUT FOR GIVEN COMMAND - RETURN CONTROL/OUTPUT

Parameters:
  • conn (conn) – connection object

  • cmd (str) – a command to be executed

  • path (str) – path where output to be stored

  • parsed_output (bool) – Need to parse output and generate excel or not.

  • visual_progress (int) – scale 0 to 10. 0 being no output, 10 all.

  • logger (list) – device logging messages list

Properties:

cmd (str): command executed commandOP, output (str) - command output fname (filename): full filename with path where output stored

add_to_file(output)

add output to a text file

Parameters:

output (str) – captured output

Returns:

filename where output got appended

Return type:

str

property commandOP

command output

op_to_file(cumulative=False)

store output of command to file, cumulative (True,False,both) to store output in a single file, individual files, both

Parameters:

cumulative (bool, optional) – True,False,both. Defaults to False.

Returns:

file name where output get stored

Return type:

str

send_to_file(output)

send output to a text file

Parameters:

output (str) – captured output

Returns:

filename where output got stored

Return type:

str