~ubuntu-branches/ubuntu/jaunty/python-docutils/jaunty

« back to all changes in this revision

Viewing changes to docutils/readers/__init__.py

  • Committer: Bazaar Package Importer
  • Author(s): martin f. krafft
  • Date: 2006-07-10 11:45:05 UTC
  • mfrom: (2.1.4 edgy)
  • Revision ID: james.westby@ubuntu.com-20060710114505-otkhqcslevewxmz5
Tags: 0.4-3
Added build dependency on python-central (closes: #377580).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# Authors: David Goodger; Ueli Schlaepfer
2
2
# Contact: goodger@users.sourceforge.net
3
 
# Revision: $Revision: 1.14 $
4
 
# Date: $Date: 2003/08/27 20:47:54 $
 
3
# Revision: $Revision: 4183 $
 
4
# Date: $Date: 2005-12-12 05:12:02 +0100 (Mon, 12 Dec 2005) $
5
5
# Copyright: This module has been placed in the public domain.
6
6
 
7
7
"""
11
11
__docformat__ = 'reStructuredText'
12
12
 
13
13
 
14
 
import sys
15
14
from docutils import utils, parsers, Component
16
15
from docutils.transforms import universal
17
16
 
30
29
    component_type = 'reader'
31
30
    config_section = 'readers'
32
31
 
33
 
    def __init__(self, parser=None, parser_name='restructuredtext'):
 
32
    def get_transforms(self):
 
33
        return Component.get_transforms(self) + [
 
34
            universal.Decorations,
 
35
            universal.ExposeInternals,
 
36
            universal.StripComments,]
 
37
 
 
38
    def __init__(self, parser=None, parser_name=None):
34
39
        """
35
40
        Initialize the Reader instance.
36
41
 
78
83
        return document
79
84
 
80
85
 
 
86
class ReReader(Reader):
 
87
 
 
88
    """
 
89
    A reader which rereads an existing document tree (e.g. a
 
90
    deserializer).
 
91
 
 
92
    Often used in conjunction with `writers.UnfilteredWriter`.
 
93
    """
 
94
 
 
95
    def get_transforms(self):
 
96
        # Do not add any transforms.  They have already been applied
 
97
        # by the reader which originally created the document.
 
98
        return Component.get_transforms(self)
 
99
 
 
100
 
81
101
_reader_aliases = {}
82
102
 
83
103
def get_reader_class(reader_name):