|
From: <md...@us...> - 2008-06-23 15:23:58
|
Revision: 5646
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5646&view=rev
Author: mdboom
Date: 2008-06-23 08:23:22 -0700 (Mon, 23 Jun 2008)
Log Message:
-----------
Fix inheritance diagram regular expression parsing.
Modified Paths:
--------------
trunk/matplotlib/doc/sphinxext/inheritance_diagram.py
Modified: trunk/matplotlib/doc/sphinxext/inheritance_diagram.py
===================================================================
--- trunk/matplotlib/doc/sphinxext/inheritance_diagram.py 2008-06-23 14:46:13 UTC (rev 5645)
+++ trunk/matplotlib/doc/sphinxext/inheritance_diagram.py 2008-06-23 15:23:22 UTC (rev 5646)
@@ -31,6 +31,7 @@
import inspect
import os
+import re
import subprocess
try:
from hashlib import md5
@@ -42,7 +43,6 @@
from sphinx.latexwriter import LaTeXTranslator
from docutils.parsers.rst import directives
from sphinx.roles import xfileref_role
-from sphinx.directives.desc import py_sig_re
class DotException(Exception):
pass
@@ -67,12 +67,16 @@
raise ValueError("No classes found for inheritance diagram")
self.show_builtins = show_builtins
+ py_sig_re = re.compile(r'''^([\w.]*\.)? # class names
+ (\w+) \s* $ # optionally arguments
+ ''', re.VERBOSE)
+
def _import_class_or_module(self, name):
"""
Import a class using its fully-qualified *name*.
"""
try:
- path, base, signature = py_sig_re.match(name).groups()
+ path, base = self.py_sig_re.match(name).groups()
except:
raise ValueError(
"Invalid class or module '%s' specified for inheritance diagram" % name)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|