summaryrefslogtreecommitdiff
path: root/sphinx/domains/python.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2011-05-15 13:52:48 +0200
committerGeorg Brandl <georg@python.org>2011-05-15 13:52:48 +0200
commitfd2c55eaea41cfb0db941c7d0538215306f1da9a (patch)
treee930a63eeab723b56cb4a281cf219602010299df /sphinx/domains/python.py
parent88a4dce9a45b76d990e2768de69eb465a5f216f7 (diff)
parentba9d023acf4361093666eaf1aa6e78b0ab41a891 (diff)
downloadsphinx-fd2c55eaea41cfb0db941c7d0538215306f1da9a.tar.gz
merge with 1.0
Diffstat (limited to 'sphinx/domains/python.py')
-rw-r--r--sphinx/domains/python.py23
1 files changed, 12 insertions, 11 deletions
diff --git a/sphinx/domains/python.py b/sphinx/domains/python.py
index 021aaaaa..4004599c 100644
--- a/sphinx/domains/python.py
+++ b/sphinx/domains/python.py
@@ -418,18 +418,19 @@ class PyModule(Directive):
modname = self.arguments[0].strip()
noindex = 'noindex' in self.options
env.temp_data['py:module'] = modname
- env.domaindata['py']['modules'][modname] = \
- (env.docname, self.options.get('synopsis', ''),
- self.options.get('platform', ''), 'deprecated' in self.options)
- # make a duplicate entry in 'objects' to facilitate searching for the
- # module in PythonDomain.find_obj()
- env.domaindata['py']['objects'][modname] = (env.docname, 'module')
- targetnode = nodes.target('', '', ids=['module-' + modname], ismod=True)
- self.state.document.note_explicit_target(targetnode)
- ret = [targetnode]
- # the platform and synopsis aren't printed; in fact, they are only used
- # in the modindex currently
+ ret = []
if not noindex:
+ env.domaindata['py']['modules'][modname] = \
+ (env.docname, self.options.get('synopsis', ''),
+ self.options.get('platform', ''), 'deprecated' in self.options)
+ # make a duplicate entry in 'objects' to facilitate searching for the
+ # module in PythonDomain.find_obj()
+ env.domaindata['py']['objects'][modname] = (env.docname, 'module')
+ targetnode = nodes.target('', '', ids=['module-' + modname], ismod=True)
+ self.state.document.note_explicit_target(targetnode)
+ # the platform and synopsis aren't printed; in fact, they are only used
+ # in the modindex currently
+ ret.append(targetnode)
indextext = _('%s (module)') % modname
inode = addnodes.index(entries=[('single', indextext,
'module-' + modname, '')])