formatter
index
/usr/lib/python2.2/formatter.py

Generic output formatting.
 
Formatter objects transform an abstract flow of formatting events into
specific output events on writer objects. Formatters manage several stack
structures to allow various properties of a writer object to be changed and
restored; writers need not be able to handle relative changes nor any sort
of ``change back'' operation. Specific writer properties which may be
controlled via formatter objects are horizontal alignment, font, and left
margin indentations. A mechanism is provided which supports providing
arbitrary, non-exclusive style settings to a writer as well. Additional
interfaces facilitate formatting events which are not reversible, such as
paragraph separation.
 
Writer objects encapsulate device interfaces. Abstract devices, such as
file formats, are supported as well as physical devices. The provided
implementations all work with abstract devices. The interface makes
available mechanisms for setting the properties which formatter objects
manage and inserting data into the output.

 
Modules
            
string
sys
 
Classes
            
AbstractFormatter
NullFormatter
NullWriter
AbstractWriter
DumbWriter
 
class AbstractFormatter
       
   Methods defined here:
__init__(self, writer)
add_flowing_data(self, data, whitespace='\t\n\x0b\x0c\r ', join=<function join>, split=<function split>)
add_hor_rule(self, *args, **kw)
add_label_data(self, format, counter, blankline=None)
add_line_break(self)
add_literal_data(self, data)
assert_line_data(self, flag=1)
end_paragraph(self, blankline)
flush_softspace(self)
format_counter(self, format, counter)
format_letter(self, case, counter)
format_roman(self, case, counter)
pop_alignment(self)
pop_font(self)
pop_margin(self)
pop_style(self, n=1)
push_alignment(self, align)
push_font(self, (size, i, b, tt))
push_margin(self, margin)
push_style(self, *styles)
set_spacing(self, spacing)

Data and non-method functions defined here:
__doc__ = None
__module__ = 'formatter'
 
class AbstractWriter(NullWriter)
       
   Methods defined here:
new_alignment(self, align)
new_font(self, font)
new_margin(self, margin, level)
new_spacing(self, spacing)
new_styles(self, styles)
send_flowing_data(self, data)
send_hor_rule(self, *args, **kw)
send_label_data(self, data)
send_line_break(self)
send_literal_data(self, data)
send_paragraph(self, blankline)

Data and non-method functions defined here:
__doc__ = None
__module__ = 'formatter'

Methods inherited from NullWriter:
__init__(self)
flush(self)
 
class DumbWriter(NullWriter)
       
   Methods defined here:
__init__(self, file=None, maxcol=72)
reset(self)
send_flowing_data(self, data)
send_hor_rule(self, *args, **kw)
send_line_break(self)
send_literal_data(self, data)
send_paragraph(self, blankline)

Data and non-method functions defined here:
__doc__ = None
__module__ = 'formatter'

Methods inherited from NullWriter:
flush(self)
new_alignment(self, align)
new_font(self, font)
new_margin(self, margin, level)
new_spacing(self, spacing)
new_styles(self, styles)
send_label_data(self, data)
 
class NullFormatter
       
   Methods defined here:
__init__(self, writer=None)
add_flowing_data(self, data)
add_hor_rule(self, *args, **kw)
add_label_data(self, format, counter, blankline=None)
add_line_break(self)
add_literal_data(self, data)
assert_line_data(self, flag=1)
end_paragraph(self, blankline)
flush_softspace(self)
pop_alignment(self)
pop_font(self)
pop_margin(self)
pop_style(self, n=1)
push_alignment(self, align)
push_font(self, x)
push_margin(self, margin)
push_style(self, *styles)
set_spacing(self, spacing)

Data and non-method functions defined here:
__doc__ = None
__module__ = 'formatter'
 
class NullWriter
      Minimal writer interface to use in testing & inheritance.
 
   Methods defined here:
__init__(self)
flush(self)
new_alignment(self, align)
new_font(self, font)
new_margin(self, margin, level)
new_spacing(self, spacing)
new_styles(self, styles)
send_flowing_data(self, data)
send_hor_rule(self, *args, **kw)
send_label_data(self, data)
send_line_break(self)
send_literal_data(self, data)
send_paragraph(self, blankline)

Data and non-method functions defined here:
__doc__ = 'Minimal writer interface to use in testing & inheritance.'
__module__ = 'formatter'
 
Functions
            
test(file=None)
 
Data
             AS_IS = None
__file__ = '/usr/lib/python2.2/formatter.pyc'
__name__ = 'formatter'