LMIShellOptions

class lmi.shell.LMIShellOptions.LMIShellOptionParser(prog=None, usage=None, description=None, epilog=None, version=None, parents=, []formatter_class=<class 'argparse.HelpFormatter'>, prefix_chars='-', fromfile_prefix_chars=None, argument_default=None, conflict_handler='error', add_help=True)[source]

Helper class for CLI option parsing.

error(msg)[source]

Prints help message, error message and exits with erro code 2.

class lmi.shell.LMIShellOptions.LMIShellOptions(argv)[source]

Class representing a LMIShell command line options. In the constructor, all command line options before a script name are passed to the LMIShell. First position argument belongs to the script and the rest of command line options is passed to the script run under the LMIShell.

Parameters:argv (list) – CLI arguments
cwd_first_in_path[source]
Returns:True, if CWD should be prepended in sys.path; False if appended
interact[source]
Returns:flag, which indicates, if the LMIShell should enter an interactive mode, after executing a provided script. The behavior is similar to python interpreter
Return type:bool
interactive[source]
Returns:flag, which tells if the LMIShell should be initially run in the interactive mode
Return type:bool
log[source]
Returns:log level
Return type:int

Log level can be one of the following:

  • _LOG_DEFAULT
  • _LOG_VERBOSE
  • _LOG_MORE_VERBOSE
  • _LOG_QUIET
script_argv[source]
Returns:list of command line arguments of the interpreted script
script_name[source]
Returns:script name, which is about to be run under the LMIShell
Return type:string
verify_server_cert[source]
Returns:flag, which indicates, if LMIShell should verify server side certificate, if SSL used
Return type:bool
class lmi.shell.LMIShellOptions.LMIShellOptionsHelpWithVersionFormatter(prog, indent_increment=2, max_help_position=24, width=None)[source]

Helper class used for help message formatting.