Package logilab :: Package common :: Package ureports :: Class BaseWriter

[frames] | no frames]

# Class BaseWriter

source code

    object --+
             |
            BaseWriter

    base class for ureport writers

Instance Methods

format(self, layout, stream=None, encoding=None) format and write the given layout into the stream object | source code

format_children(self, layout) recurse on the layout children and call their accept method... | source code

writeln(self, string=u'') write a line in the output buffer | source code

write(self, string) write a string in the output buffer | source code

begin_format(self, layout) begin to format a layout | source code

end_format(self, layout) finished to format a layout | source code

get_table_content(self, table) trick to get table content without actually writing it | source code

compute_content(self, layout) trick to compute the formatting of children layout before actually writing it | source code

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

Properties
Inherited from `object`: `__class__`

Method Details

### format(self, layout, stream=None, encoding=None)

source code

    format and write the given layout into the stream object

    unicode policy: unicode strings may be found in the layout;
    try to call stream.write with it, but give it back encoded using
    the given encoding if it fails

### format_children(self, layout)

source code

    recurse on the layout children and call their accept method
    (see the Visitor pattern)

### get_table_content(self, table)

source code

    trick to get table content without actually writing it

    return an aligned list of lists containing table cells values as string

### compute_content(self, layout)

source code

    trick to compute the formatting of children layout before actually
    writing it

    return an iterator on strings (one for each child element)