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

Class JobFormatAssembler

object --+
         |
        ListView.JobFormatAssembler

Small class to assemble the formatted job output.

It is created with a reference to a view and parameters for assembling output. height is the number of lines which need to be filled, and anchor is a line relative to the top of the height around which job output is placed.

Once all job output is added, the formatted lines can be fetched in one call.

Instance Methods [hide private]
 
__init__(self, view, height, anchor)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
 
needs_more_above(self)
 
needs_more_below(self)
 
add_job_above(self, job, search)
Put a job's output at the top of the formatted output, above the anchor and any other jobs already added with this function.
 
add_job_below(self, job, search)
Put a job's output at the bottom of the formatted output, below the anchor and any other jobs already added with this function.
MutableText
get_lines(self)
Return the formatted lines
int
distance_to_visible(self)
The number of lines from the last formatted line to the top of the visible area.
 
check_visible(self, job)
Check if the provided job is visible.
 
tail_visible(self, job)
Return True if the tail of the given job is visible.

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, height, anchor)
(Constructor)

 

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

Parameters:
  • view - The ListView being formatted for.
  • height - The number of lines to format.
  • anchor - The line around which job output is placed.
Overrides: object.__init__

add_job_above(self, job, search)

 

Put a job's output at the top of the formatted output, above the anchor and any other jobs already added with this function.

Returns:
job_drawn_lines data

add_job_below(self, job, search)

 

Put a job's output at the bottom of the formatted output, below the anchor and any other jobs already added with this function.

Returns:
job_drawn_lines data

distance_to_visible(self)

 

The number of lines from the last formatted line to the top of the visible area.

This value is positive and relevant when anchor is negative and not enough output has been added below to reach the visible area.

Returns: int

check_visible(self, job)

 

Check if the provided job is visible. If it is, return it, otherwise return a newjob which is.

Returns:
a job index into the View's .jobs array. @rrtype int