summaryrefslogtreecommitdiff
path: root/sphinx/ext/autodoc.py
diff options
context:
space:
mode:
authorBogdan Opanchuk <bogdan@opanchuk.net>2013-04-20 21:58:18 +1000
committerBogdan Opanchuk <bogdan@opanchuk.net>2013-04-20 21:58:18 +1000
commit91c3dd4541dee0e22a5e2223c33e0bfd93ffdba9 (patch)
treecd043276da777b356dc247f2350591c696839d4f /sphinx/ext/autodoc.py
parent1d963f7e655d45975362b7e4fec1878537970301 (diff)
downloadsphinx-91c3dd4541dee0e22a5e2223c33e0bfd93ffdba9.tar.gz
Added ``imported-members`` option for ``automodule`` directive in autodoc
Diffstat (limited to 'sphinx/ext/autodoc.py')
-rw-r--r--sphinx/ext/autodoc.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py
index 555a3106..432b9ec2 100644
--- a/sphinx/ext/autodoc.py
+++ b/sphinx/ext/autodoc.py
@@ -364,6 +364,9 @@ class Documenter(object):
"""Check if *self.object* is really defined in the module given by
*self.modname*.
"""
+ if self.options.imported_members:
+ return True
+
modname = self.get_attr(self.object, '__module__', None)
if modname and modname != self.modname:
return False
@@ -770,6 +773,7 @@ class ModuleDocumenter(Documenter):
'platform': identity, 'deprecated': bool_option,
'member-order': identity, 'exclude-members': members_set_option,
'private-members': bool_option, 'special-members': members_option,
+ 'imported-members': bool_option,
}
@classmethod