merge with trunk

This commit is contained in:
Georg Brandl 2009-09-04 00:17:41 +02:00
commit 0d029eeb9c
11 changed files with 18 additions and 19 deletions

View File

@ -39,9 +39,15 @@ Release 1.0 (in development)
* Added simplified Chinese locale. * Added simplified Chinese locale.
Release 0.6.3 (in development) Release 0.6.4 (in development)
============================== ==============================
Release 0.6.3 (Sep 03, 2009)
============================
* Properly add C module filenames as dependencies in autodoc.
* #253: Ignore graphviz directives without content instead of * #253: Ignore graphviz directives without content instead of
raising an unhandled exception. raising an unhandled exception.

View File

@ -29,7 +29,7 @@ from sphinx.domains import all_domains
from sphinx.builders import BUILTIN_BUILDERS from sphinx.builders import BUILTIN_BUILDERS
from sphinx.directives import GenericDesc, Target, additional_xref_types from sphinx.directives import GenericDesc, Target, additional_xref_types
from sphinx.environment import BuildEnvironment, SphinxStandaloneReader from sphinx.environment import BuildEnvironment, SphinxStandaloneReader
from sphinx.util import pycompat from sphinx.util import pycompat # imported for side-effects
from sphinx.util.tags import Tags from sphinx.util.tags import Tags
from sphinx.util.compat import Directive, directive_dwim from sphinx.util.compat import Directive, directive_dwim
from sphinx.util.console import bold from sphinx.util.console import bold

View File

@ -10,7 +10,6 @@
""" """
import codecs import codecs
import shutil
from os import path from os import path
from cgi import escape from cgi import escape

View File

@ -22,11 +22,6 @@ import cPickle as pickle
from os import path from os import path
from glob import glob from glob import glob
from itertools import izip, groupby from itertools import izip, groupby
try:
from hashlib import md5
except ImportError:
# 2.4 compatibility
from md5 import md5
from docutils import nodes from docutils import nodes
from docutils.io import FileInput, NullOutput from docutils.io import FileInput, NullOutput

View File

@ -14,8 +14,7 @@
import re import re
import sys import sys
import inspect import inspect
from types import ModuleType, FunctionType, BuiltinFunctionType, MethodType, \ from types import FunctionType, BuiltinFunctionType, MethodType, ClassType
ClassType
from docutils import nodes from docutils import nodes
from docutils.utils import assemble_option_dict from docutils.utils import assemble_option_dict
@ -626,11 +625,15 @@ class Documenter(object):
# try to also get a source code analyzer for attribute docs # try to also get a source code analyzer for attribute docs
try: try:
self.analyzer = ModuleAnalyzer.for_module(self.real_modname) self.analyzer = ModuleAnalyzer.for_module(self.real_modname)
# parse right now, to get PycodeErrors on parsing # parse right now, to get PycodeErrors on parsing (results will
self.analyzer.parse() # be cached anyway)
self.analyzer.find_attr_docs()
except PycodeError, err: except PycodeError, err:
# no source file -- e.g. for builtin and C modules # no source file -- e.g. for builtin and C modules
self.analyzer = None self.analyzer = None
# at least add the module.__file__ as a dependency
if hasattr(self.module, '__file__') and self.module.__file__:
self.directive.filename_set.add(self.module.__file__)
else: else:
self.directive.filename_set.add(self.analyzer.srcname) self.directive.filename_set.add(self.analyzer.srcname)

View File

@ -10,9 +10,7 @@
:license: BSD, see LICENSE for details. :license: BSD, see LICENSE for details.
""" """
import os
import re import re
import sys
import posixpath import posixpath
from os import path from os import path
from subprocess import Popen, PIPE from subprocess import Popen, PIPE

View File

@ -36,11 +36,9 @@
:license: BSD, see LICENSE for details. :license: BSD, see LICENSE for details.
""" """
import os
import re import re
import sys import sys
import inspect import inspect
import subprocess
try: try:
from hashlib import md5 from hashlib import md5
except ImportError: except ImportError:

View File

@ -9,7 +9,6 @@
:license: BSD, see LICENSE for details. :license: BSD, see LICENSE for details.
""" """
import codecs
from os import path from os import path
from pprint import pformat from pprint import pformat

View File

@ -234,6 +234,8 @@ class ModuleAnalyzer(object):
attr_visitor = AttrDocVisitor(number2name, scope, self.encoding) attr_visitor = AttrDocVisitor(number2name, scope, self.encoding)
attr_visitor.visit(self.parsetree) attr_visitor.visit(self.parsetree)
self.attr_docs = attr_visitor.collected self.attr_docs = attr_visitor.collected
# now that we found everything we could in the tree, throw it away
# (it takes quite a bit of memory for large modules)
self.parsetree = None self.parsetree = None
return attr_visitor.collected return attr_visitor.collected

View File

@ -10,7 +10,6 @@
""" """
import re import re
import cPickle as pickle import cPickle as pickle
from cStringIO import StringIO
from docutils.nodes import comment, Text, NodeVisitor, SkipNode from docutils.nodes import comment, Text, NodeVisitor, SkipNode

View File

@ -443,7 +443,7 @@ def split_explicit_title(text):
"""Split role content into title and target, if given.""" """Split role content into title and target, if given."""
match = explicit_title_re.match(text) match = explicit_title_re.match(text)
if match: if match:
return True, m.group(1), m.group(2) return True, match.group(1), match.group(2)
return False, text, text return False, text, text