#!/usr/bin/env python
"""Patched version of Epydoc that does not blow up with `docutils`
newer than 0.6 when reST is used as a markup language"""

from epydoc.cli import cli
from epydoc.markup.restructuredtext import parse_docstring
from epydoc.docwriter.latex import LatexWriter

# Check whether Epydoc needs patching
doc = parse_docstring("aaa", [])
try:
	doc.summary()
except AttributeError:
	# Monkey-patching docutils so that Text nodes have a "data" property,
	# which is always empty
	from docutils.nodes import Text
	Text.data=""

LatexWriter.PREAMBLE += [r'\usepackage[T1]{fontenc}']
cli()