formatter.command

Contains command classes used to control formatters from inside of command execution functions.

class lmi.scripts.common.formatter.command.FormatterCommand[source]

Base class for formatter commands.

class lmi.scripts.common.formatter.command.NewHostCommand(hostname)[source]

Command for formatter to finish current table (if any), print header for new host and (if there are any data) print table header.

Parameters:hostname (string) – Name of host appearing at the front of new table.
class lmi.scripts.common.formatter.command.NewTableCommand(title=None)[source]

Command for formatter to finish current table (if any), print the title and (if there are any data) print table header.

Parameters:title (string) – Optional title for new table.
class lmi.scripts.common.formatter.command.NewTableHeaderCommand(columns=None)[source]

Command for formatter to finish current table (if any), store new table header and (if there are any data) print the table header. The table header will be printed in all subsequent tables, until new instance of this class arrives.

Parameters:columns (tuple) – Array of column names.