Update reStructuredText parser for compatability with DocUtils v0.7.
This patch brings EpyDoc's usage of docutils.nodes.Text objects inline with
API changes made in DocUtils v0.6.
Specicially, Text objects no longer expose a `data` attribute holding the
objects string data, rather Text objects subclass Python's unicode class. It
follows that code which used to access this data as, say, `child.data` can now
access it simply as `child`.
Modification (as opposed to accessing) is slightly trickier. For instance a
sub-string can be obtained using slices (e.g. `Text[2:]`) but the object
returned is a `unicode` instance, not a `Text` instance. The can be easily
worked around by constructing a `Text` object from the string data, for
child.data = child.data[2:].strip()
child = docutils.node.Text( child[2:].strip() )
I wasn't able to find a test-suite for EpyDoc (the `epydoc/test` package looks
for `*.doctest` files, of which there are none), but this "works for me" on a
Python project containing 25,816 docstrings.
Log in to post a comment.