LMIMethod¶
- class lmi.shell.LMIMethod.LMIMethod(conn, lmi_instance, method_name)[source]¶
LMI wrapper class representing wbem.CIMMethod.
Parameters: - conn (LMIConnection) – connection object
- lmi_instance (LMIInstance(Name)) – LMIInstance or LMIInstanceName object, on which the method call will be issued
- method_name (string) – method name
- doc()[source]¶
Prints out pretty verbose message with documentation for the class. If the LMIShell is run in a interactive mode, the output will be redirected to a pager set by environment variable PAGER. If there is not PAGER set, less or more will be used as a fall-back.
- class lmi.shell.LMIMethod.LMIMethodSignalHelper[source]¶
Helper class which takes care of signal (de)registration and handling.
- callback_attach(cb_name, cb)[source]¶
Registers a callback, which will be called when a SIGINT or SIGTERM is caught.
Parameters: - cb_name (string) – callback name
- cb – callable object, which takes zero arguments
- callback_detach(cb_name)[source]¶
Removes a callback from the callback dictionary.
Parameters: cb_name (string) – callback name
- signal_attach()[source]¶
Registers SIGINT and SIGTERM signals to local handler in which, the flags for each signal are modified, if such signal is caught.
- signal_detach()[source]¶
Unregisters SIGINT and SIGTERM handler and removes all the attached callbacks.
- class lmi.shell.LMIMethod.LMISignalHelperBase[source]¶
Base signal handling class.
- static signal(signo, handler)[source]¶
Calls signal() for signo, handler and returns the old signal handler. If signo is list of signals, the signal() call is applied for each signo. If handler is also list, each signal from signo will be handled by corresponding handler. In such case, tuple of previous handlers will be returned.