Format

Formatting details for Serializers.


Attributes

a re_trailing_blanks

<_sre.SRE_Pattern object at 0xb799d128>

a re_emdash

<_sre.SRE_Pattern object at 0xb7b4ad40>

a re_dbackticks

<_sre.SRE_Pattern object at 0xb7a80020>

a re_endash

<_sre.SRE_Pattern object at 0xb799d180>

a re_squote_left

<_sre.SRE_Pattern object at 0xb7c13bf0>

a dquotes

u'\u201c\u201d'

a re_dquote_left

<_sre.SRE_Pattern object at 0xb7c13c98>

a squotes

u'\u2018\u2019'

a wrap

80

a re_squotes

<_sre.SRE_Pattern object at 0xb7b69bf0>

a re_leading_blanks

<_sre.SRE_Pattern object at 0xb799d0d0>

a re_whitespace

<_sre.SRE_Pattern object at 0xb7b20bf0>

a re_duplicate_newlines

<_sre.SRE_Pattern object at 0xb7b52a20>

a re_squote_right

<_sre.SRE_Pattern object at 0xb7c15df0>

a tabsize

8

a ellipsis

u'\u2026'

a dashes

u'\u2013\u2014'

a re_sbackticks

<_sre.SRE_Pattern object at 0xb7b69c80>

a re_ellipses

<_sre.SRE_Pattern object at 0xb7b4e6e0>

a max_level

8

a re_hyphen_between_blanks

<_sre.SRE_Pattern object at 0xb7b4ada0>

a re_duplicate_blanks

<_sre.SRE_Pattern object at 0xb7b16a70>

a re_whitespace_with_newline

<_sre.SRE_Pattern object at 0xb79969b0>

a re_dquote_right

<_sre.SRE_Pattern object at 0xb7c15ec0>

a re_squote_decade

<_sre.SRE_Pattern object at 0xb7b547a0>

a apostrophe

u'\u2019'

a min_level

1

a indent

'\t'

a re_indentation

<_sre.SRE_Pattern object at 0xb7b4ace0>

a re_dquotes

<_sre.SRE_Pattern object at 0xb7b69c38>

Methods

f __init__(self) ...

Create an output format with given parameters.

You can pass one or more text filter functions for processing text content in the output stream.

You can also set keyword parameters for using some standard text filter operations. The following parameters must be set to True to activate the operation:

strip_lines: strip blanks in all text lines lstrip_lines: left strip blanks in all text lines rstrip_lines: right strip blanks in all text lines simple_blanks: remove all duplicate blanks no_empty_lines: remove all empty lines simple_whitespace: remove all duplicate whitespace wrap: wrap text lines to a maximum width

You can also specify the exact width using the wrap parameter.

There are some more operations which you should use with caution, since they may remove significant whitespace:

strip: strip whitespace lstrip: left strip whitespace rstrip: right strip whitespace strip_blanks: strip blanks lstrip_blanks: left strip blanks rstrip_blanks: right strip blanks

The following parameters control typographic punctuation.

educate_quotes: use typographic quotes educate_backticks: replace backticks with opening quotes educate_dashes: replace en-dashes and em-dashes educate_ellipses: replace ellipses educate (or nice): all of the above stupefy (or ugly): reverse operation of educate

apostrophe: character to be used for the apostrophe squotes: left and right single quote characters dquotes: left and right double quote characters dashes: characters to be used for en-dash and em-dash ellipsis: character to be used for the ellipsis

The following parameters control indentation. This will insert newlines and level-dependent indentation, paying regard to inline and whitespace senstive tags:

indent: string or number of blanks for indentation min_level: minimum level for indentation max_level: maximum level for indentation

Note that this formatting has some limitations since it processes only text content in a stream (no look-ahead, no paying regard to the format of the serialized tags).

The following parameters are passed to the Serializer (see there for the possible values of these parameters):

decl: add xml declaration at the beginning doctype: add document type at the beginning entity_map (or named): entity map for named entities transpose: how to transpose html tags inject_type: inject meta tag with content-type

See the source for more information.