3.4. commands module

class nettoolkit.capture_it.command.COMMAND(conn, cmd, parsed_output, standard_output, del_old_file)[source]

Bases: object

CAPTURE OUTPUT FOR GIVEN COMMAND - RETURN CONTROL/OUTPUT

Parameters:
  • conn (conn) – connection object

  • cmd (str) – a command to be executed

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

Properties:

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

add_to_file(output)[source]

add output to a text file

Parameters:

output (str) – captured output

Returns:

filename where output got appended

Return type:

str

property commandOP

command output

get_cmd_banner()[source]
send_to_file(output)[source]

send output to a text file

Parameters:

output (str) – captured output

Returns:

filename where output got stored

Return type:

str

nettoolkit.capture_it.command.delete_file_ifexist(fname)[source]

deletes file

Parameters:

fname (str) – file name with full path.