File: pseudoxml.py

package info (click to toggle)
python-docutils 0.4-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 5,496 kB
  • ctags: 3,391
  • sloc: python: 30,436; lisp: 2,881; sh: 2,606; makefile: 108
file content (33 lines) | stat: -rw-r--r-- 828 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Authors: David Goodger
# Contact: goodger@users.sourceforge.net
# Revision: $Revision: 1645 $
# Date: $Date: 2003-08-27 22:50:43 +0200 (Wed, 27 Aug 2003) $
# Copyright: This module has been placed in the public domain.

"""
Simple internal document tree Writer, writes indented pseudo-XML.
"""

__docformat__ = 'reStructuredText'


from docutils import writers


class Writer(writers.Writer):

    supported = ('pprint', 'pformat', 'pseudoxml')
    """Formats this writer supports."""

    config_section = 'pseudoxml writer'
    config_section_dependencies = ('writers',)

    output = None
    """Final translated form of `document`."""

    def translate(self):
        self.output = self.document.pformat()

    def supports(self, format):
        """This writer supports all format-specific elements."""
        return 1