mac_maker.utilities.shell

Interruptable command loop for the click_shell module.

class mac_maker.utilities.shell.CommandLoop[source]

Command Loop with interrupt for the click_shell module.

exit(exit_code, pid)[source]

Exit a process, without interrupting the command loop.

Parameters
  • exit_code (int) – The code that will be used to exit.

  • pid (int) – The process ID that will be terminated.

Return type

None

exit_shell(exit_code, pid)[source]

Interrupt the command loop and exit the process.

Parameters
  • exit_code (int) – The code that will be used to exit.

  • pid (int) – The process ID that will be terminated.

Return type

None

interrupt(exit_code, pid)[source]

Interrupt the command loop, without terminating the process.

Parameters
  • exit_code (int) – The code that will be used to exit.

  • pid (int) – The process ID that will be terminated.

Return type

None

patch_interrupt(postcmd)[source]

Patch the postcmd method of a cmd.Cmd instance.

Parameters

postcmd (Callable[..., bool]) – The postcmd method of a cmd.Cmd instance.

Return type

Callable[..., bool]

Returns

A patched postcmd method that is interruptable.