buildframework/helium/external/python/lib/common/docutils-0.5-py2.5.egg/docutils/writers/pseudoxml.py
author wbernard
Wed, 23 Dec 2009 19:29:07 +0200
changeset 179 d8ac696cc51f
permissions -rw-r--r--
helium_7.0-r14027
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
     1
# $Id: pseudoxml.py 4564 2006-05-21 20:44:42Z wiemann $
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
     2
# Author: David Goodger <goodger@python.org>
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
     3
# Copyright: This module has been placed in the public domain.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
     4
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
     5
"""
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
     6
Simple internal document tree Writer, writes indented pseudo-XML.
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
     7
"""
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
     8
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
     9
__docformat__ = 'reStructuredText'
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    10
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    11
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    12
from docutils import writers
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    13
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    14
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    15
class Writer(writers.Writer):
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    16
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    17
    supported = ('pprint', 'pformat', 'pseudoxml')
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    18
    """Formats this writer supports."""
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    19
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    20
    config_section = 'pseudoxml writer'
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    21
    config_section_dependencies = ('writers',)
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    22
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    23
    output = None
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    24
    """Final translated form of `document`."""
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    25
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    26
    def translate(self):
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    27
        self.output = self.document.pformat()
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    28
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    29
    def supports(self, format):
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    30
        """This writer supports all format-specific elements."""
d8ac696cc51f helium_7.0-r14027
wbernard
parents:
diff changeset
    31
        return 1