titus.inspector.defs.Mode

class titus.inspector.defs.Mode[source]

Bases: object

A mode of operation for the pfainspector.

This concrete base class is a read-eval-print loop for responding to the user’s commands.

__init__()

Create the main mode.

If titus.inspector.defs.CONFIG_DIRECTORY_EXISTS is True, get the readline history file from the user’s titus.inspector.defs.CONFIG_DIRECTORY.

loop()

Main loop: attempts to evaluate commands.

An EOFError exception (user typed control-D on an empty line) quits the pfainspector.

A KeyboardInterrupt exception (user typed control-C at any time) jumps to an empty command-line state.

Any titus.inspector.defs.InspectorError results in the error’s message being printed on the screen.

Any other exception results in a full stack trace being printed on the screen.

pause()

Write the current history to the history file and stop readline.

resume()

Read the history file and restart readline.