Package ClusterShell :: Package CLI :: Module Display :: Class Display
[hide private]
[frames] | no frames]

Class Display

source code


Output display class for command line scripts.

Nested Classes [hide private]
  _KeySet
Private NodeSet substition to display raw keys
Instance Methods [hide private]
 
__init__(self, options, config=None, color=None)
Initialize a Display object from CLI.OptionParser options and optional CLI.ClushConfig.
source code
 
flush(self)
flush display object buffers
source code
 
_getlmode(self)
line_mode getter
source code
 
_setlmode(self, value)
line_mode setter
source code
 
_format_nodeset(self, nodeset)
Sub-routine to format nodeset string.
source code
 
format_header(self, nodeset, indent=0)
Format nodeset-based header.
source code
 
print_line(self, nodeset, line)
Display a line with optional label.
source code
 
print_line_error(self, nodeset, line)
Display an error line with optional label.
source code
 
print_gather(self, nodeset, obj)
Generic method for displaying nodeset/content according to current object settings.
source code
 
print_gather_finalize(self, nodeset)
Finalize display of diff-like gathered contents.
source code
 
print_gather_keys(self, keys, obj)
Generic method for displaying raw keys/content according to current object settings (used by clubak).
source code
 
_print_content(self, nodeset, content)
Display a dshbak-like header block and content.
source code
 
_print_diff(self, nodeset, content)
Display unified diff between remote gathered outputs.
source code
 
_print_lines(self, nodeset, msg)
Display a MsgTree buffer by line with prefixed header.
source code
 
vprint(self, level, message)
Utility method to print a message if verbose level is high enough.
source code
 
vprint_err(self, level, message)
Utility method to print a message on stderr if verbose level is high enough.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  COLOR_RESULT_FMT = '\x1b[32m%s\x1b[0m'
  COLOR_STDOUT_FMT = '\x1b[34m%s\x1b[0m'
  COLOR_STDERR_FMT = '\x1b[31m%s\x1b[0m'
  COLOR_DIFFHDR_FMT = '\x1b[1m%s\x1b[0m'
  COLOR_DIFFHNK_FMT = '\x1b[36m%s\x1b[0m'
  COLOR_DIFFADD_FMT = '\x1b[32m%s\x1b[0m'
  COLOR_DIFFDEL_FMT = '\x1b[31m%s\x1b[0m'
  SEP = '---------------'
Properties [hide private]
  line_mode
line_mode getter

Inherited from object: __class__

Method Details [hide private]

__init__(self, options, config=None, color=None)
(Constructor)

source code 

Initialize a Display object from CLI.OptionParser options and optional CLI.ClushConfig.

If `color' boolean flag is not specified, it is auto detected according to options.whencolor.

Overrides: object.__init__

Property Details [hide private]

line_mode

line_mode getter

Get Method:
_getlmode(self) - line_mode getter
Set Method:
_setlmode(self, value) - line_mode setter