blob: 6e4c7dfd2a0f5f4bfd2557f42a5254be77a52221 (
plain)
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
|
"""reader.py - docutils Reader for Python source code
:Author: Tibs
:Contact: tibs@tibsnjoan.co.uk
:Revision: $Revision$
:Date: $Date$
:Copyright: This module has been placed in the public domain.
"""
__docformat__ = 'reStructuredText'
import docutils.readers
from docutils.readers.python.moduleparser import Node, parse_module
#from package import parse_package
from transform import make_document
class Reader(docutils.readers.Reader):
"""A Python source code specific Reader.
"""
config_section = 'python reader'
config_section_dependencies = ('readers',)
def parse(self):
"""Parse `self.input` into a document tree."""
tree = parse_module(self.input,self.source.source_path)
self.document = document = make_document(tree)
#self.document = document = self.new_document()
#self.parser.parse(self.input, document)
document.current_source = document.current_line = None
|