Package hsh :: Package curses_display :: Module list_view :: Class ListView :: Class JobFormatFetcher
[hide private]
[frames] | no frames]

Class JobFormatFetcher

object --+
         |
        ListView.JobFormatFetcher

Class to simplify accessing a job's formatted header and output.

It's a very restrictive class, and can only be used by making the following three calls in order:

  1. Construction: Provide a job and formatting direction.
  2. Line Skipping: call skip_lines_head() or skip_lines_tail() to give the number of lines which don't need to be formatted.
  3. Output Accessing: call one of get_lines_head(), get_lines_tail(), search_lines_head() or search_lines_tail(), which start from where the previous skip call ended. The get functions return the requested number of formatted lines and the search functions return a line number where the search matched.
Instance Methods [hide private]
 
__init__(self, view, job, tail, search)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
 
skip_lines_tail(self, count)
 
skip_lines_head(self, count)
MutableText
get_lines_tail(self, count)
Returns: The formatted text
(MutableText, boolean)
get_lines_head(self, count)
Returns: The formatted text and a boolean which is True if more was available.
 
search_lines_tail(self, pattern)
Returns: Line from top of job where pattern matches or None
 
search_lines_head(self, pattern)
Returns: Line from top of job where pattern matches or None

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, view, job, tail, search)
(Constructor)

 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Parameters:
  • view - The ListView this is formatting for.
  • job - Index of job to format.
  • tail - Boolean, true means format from the tail.
  • search - Compiled regexp for search highlighting.
Overrides: object.__init__

get_lines_tail(self, count)

 
Returns: MutableText
The formatted text

get_lines_head(self, count)

 
Returns: (MutableText, boolean)
The formatted text and a boolean which is True if more was available.

search_lines_tail(self, pattern)

 
Returns:
Line from top of job where pattern matches or None

search_lines_head(self, pattern)

 
Returns:
Line from top of job where pattern matches or None