LMIFormatter Package

class lmi.shell.LMIFormatter.LMIFormatter[source]

Abstract class for XML formatter and MOF formatter.

fancy_format(interactive)[source]

Formats a block of text. If the LMIShell is running in interactive mode, pager will be used, otherwise the output will be written to standard output.

Parameters:interactive (bool) – defines, if to use pager
format(indent=0, sub_indent=0, width=80, f=<open file '<stdout>', mode 'w' at 0xf731a078>)[source]

Formats a block of text and prints it to the output stream.

Parameters:
  • indent (int) – number of spaces to indent the text block
  • sub_indent (int) – number of spaces for the second and other lines of the text block
  • width (int) – total text block width
  • f – output stream
class lmi.shell.LMIFormatter.LMIMofFormatter(mof)[source]

MOF formatter used for CIMInstance.doc() to print pretty verbose help message.

Parameters:mof (string) – MOF representation of a object
format(indent=0, sub_indent=0, width=80, f=<open file '<stdout>', mode 'w' at 0xf731a078>)[source]

Formats a MOF object and prints it to the output stream.

Parameters:
  • indent (int) – number of spaces to indent the text block
  • sub_indent (int) – number of spaces for the second and other lines of the text block
  • width (int) – total text block width
  • f – output stream
class lmi.shell.LMIFormatter.LMITextFormatter(text)[source]

Text formatter class. Used when printing a block of text to output stream.

Parameters:text (string) – text to be formatted
format(indent=0, sub_indent=0, width=80, f=<open file '<stdout>', mode 'w' at 0xf731a078>, **kwargs)[source]

Formats a block of text and prints it to the output stream.

Parameters:
  • indent (int) – number of spaces to indent the text block
  • sub_indent (int) – number of spaces for the second and other lines of the text block
  • width (int) – total text block width
  • f – output stream
  • kwargs (dictionary) –

    supported keyword arguments

    • separator (bool) – if True, there will be a new line appended after the formatted text
class lmi.shell.LMIFormatter.LMIXmlFormatter(xml)[source]

XML formatter used for CIMClass.doc() to print pretty verbose help message.

Parameters:xml (pywbem.cim_xml.CLASS) – – class element
format(indent=0, sub_indent=0, width=80, f=<open file '<stdout>', mode 'w' at 0xf731a078>)[source]

Formats a XML object and prints it to the output stream.

Parameters:
  • indent (int) – number of spaces to indent the text block
  • sub_indent (int) – number of spaces for the second and other lines of the text block
  • width (int) – total text block width
  • f – output stream

Previous topic

LMIShellConfig Package

Next topic

LMIDecorators Package

This Page