LMIConsole

class lmi.shell.LMIConsole.LMIConsole(cwd_first_in_path=False)[source]

Class representing an interactive console.

clear_history()[source]

Clears the current history.

interact(locals=None)[source]

Starts the interactive mode.

Parameters:locals (dictionary) – locals
interpret(script_name, script_argv, locals=None, interactive=False)[source]

Interprets a specified script within additional provided locals. There are LMIConsole.DEFAULT_LOCALS present.

Parameters:
  • script_name (string) – script name
  • script_argv (list) – script CLI arguments
  • locals (dictionary) – dictionary with locals
  • interactive (bool) – tells LMIShell, if the script should be treated as if it was run in interactive mode
Returns:

exit code of the script

Return type:

int

load_history()[source]

Loads the shell’s history from the history file.

save_history()[source]

Saves current history of commands into the history file. If the length of history exceeds a maximum history file length, the history will be truncated.

set_verify_server_certificate(verify_server_cert=True)[source]

Turns on or off server side certificate verification, if SSL used.

Parameters:verify_server_cert (bool) – – flag which tells, whether a server side certificate needs to be verified, if SSL used
setup_completer()[source]

Initializes tab-completer.