diff options
| author | Takayuki Shimizukawa <shimizukawa+bitbucket@gmail.com> | 2014-05-28 00:08:48 +0900 |
|---|---|---|
| committer | Takayuki Shimizukawa <shimizukawa+bitbucket@gmail.com> | 2014-05-28 00:08:48 +0900 |
| commit | 2bea449254abb21a56f4d7193ece32afb2da82f8 (patch) | |
| tree | 209431e7c8f4ff28f2cbc9e579aeeb570418f41a /sphinx/domains/python.py | |
| parent | 362225b5cf5642e50990d633eae241721ed640b4 (diff) | |
| parent | 88fe3b0b04f3fff0fce6c9b99d5da73dd5dda880 (diff) | |
| download | sphinx-2bea449254abb21a56f4d7193ece32afb2da82f8.tar.gz | |
Merged in vitaut/sphinx/cpp-variadic (pull request #241)
Add support for variadic templates in C++ domain
Diffstat (limited to 'sphinx/domains/python.py')
| -rw-r--r-- | sphinx/domains/python.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sphinx/domains/python.py b/sphinx/domains/python.py index 9e083a12..1780b4a1 100644 --- a/sphinx/domains/python.py +++ b/sphinx/domains/python.py @@ -11,6 +11,7 @@ import re +from six import iteritems from docutils import nodes from docutils.parsers.rst import directives @@ -514,7 +515,7 @@ class PythonModuleIndex(Index): ignores = self.domain.env.config['modindex_common_prefix'] ignores = sorted(ignores, key=len, reverse=True) # list of all modules, sorted by module name - modules = sorted(self.domain.data['modules'].iteritems(), + modules = sorted(iteritems(self.domain.data['modules']), key=lambda x: x[0].lower()) # sort out collapsable modules prev_modname = '' @@ -564,7 +565,7 @@ class PythonModuleIndex(Index): collapse = len(modules) - num_toplevels < num_toplevels # sort by first letter - content = sorted(content.iteritems()) + content = sorted(iteritems(content)) return content, collapse @@ -619,10 +620,10 @@ class PythonDomain(Domain): ] def clear_doc(self, docname): - for fullname, (fn, _) in self.data['objects'].items(): + for fullname, (fn, _) in list(self.data['objects'].items()): if fn == docname: del self.data['objects'][fullname] - for modname, (fn, _, _, _) in self.data['modules'].items(): + for modname, (fn, _, _, _) in list(self.data['modules'].items()): if fn == docname: del self.data['modules'][modname] @@ -720,8 +721,8 @@ class PythonDomain(Domain): contnode, name) def get_objects(self): - for modname, info in self.data['modules'].iteritems(): + for modname, info in iteritems(self.data['modules']): yield (modname, modname, 'module', info[0], 'module-' + modname, 0) - for refname, (docname, type) in self.data['objects'].iteritems(): + for refname, (docname, type) in iteritems(self.data['objects']): if type != 'module': # modules are already handled yield (refname, refname, type, docname, refname, 1) |
