summaryrefslogtreecommitdiff
path: root/sphinx/ext/autosummary/generate.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2011-01-15 15:10:30 +0100
committerGeorg Brandl <georg@python.org>2011-01-15 15:10:30 +0100
commite7fa3c6f45f9917d0a3ded691ef01e1da36ce20b (patch)
tree49a704833bbd6b138646632959456bc8243f2bf3 /sphinx/ext/autosummary/generate.py
parentc0aad06b9614866031003044a9fa93851f774c94 (diff)
downloadsphinx-git-e7fa3c6f45f9917d0a3ded691ef01e1da36ce20b.tar.gz
#347: use autodoc documenter detection in autosummary.
Diffstat (limited to 'sphinx/ext/autosummary/generate.py')
-rw-r--r--sphinx/ext/autosummary/generate.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/sphinx/ext/autosummary/generate.py b/sphinx/ext/autosummary/generate.py
index f8230216c..b5ff3f4ca 100644
--- a/sphinx/ext/autosummary/generate.py
+++ b/sphinx/ext/autosummary/generate.py
@@ -107,7 +107,7 @@ def generate_autosummary_docs(sources, output_dir=None, suffix='.rst',
ensuredir(path)
try:
- obj, name = import_by_name(name)
+ name, obj, parent = import_by_name(name)
except ImportError, e:
warn('[autosummary] failed to import %r: %s' % (name, e))
continue
@@ -123,7 +123,7 @@ def generate_autosummary_docs(sources, output_dir=None, suffix='.rst',
f = open(fn, 'w')
try:
- doc = get_documenter(obj)
+ doc = get_documenter(obj, parent)
if template_name is not None:
template = template_env.get_template(template_name)
@@ -137,7 +137,7 @@ def generate_autosummary_docs(sources, output_dir=None, suffix='.rst',
def get_members(obj, typ, include_public=[]):
items = [
name for name in dir(obj)
- if get_documenter(getattr(obj, name)).objtype == typ
+ if get_documenter(getattr(obj, name), obj).objtype == typ
]
public = [x for x in items
if x in include_public or not x.startswith('_')]
@@ -211,7 +211,7 @@ def find_autosummary_in_docstring(name, module=None, filename=None):
See `find_autosummary_in_lines`.
"""
try:
- obj, real_name = import_by_name(name)
+ real_name, obj, parent = import_by_name(name)
lines = pydoc.getdoc(obj).splitlines()
return find_autosummary_in_lines(lines, module=name, filename=filename)
except AttributeError: