summaryrefslogtreecommitdiff
path: root/sandbox/py-rest-doc/sphinx/environment.py
diff options
context:
space:
mode:
authorgbrandl <gbrandl@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2007-07-20 15:41:00 +0000
committergbrandl <gbrandl@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2007-07-20 15:41:00 +0000
commitbb333974420adb61ffefe8d67ecb741a12be759a (patch)
tree560309cad1029c43ecc0f91a123a5a65e36139e9 /sandbox/py-rest-doc/sphinx/environment.py
parentfd720385f10fe99ccb3f98d184bc4050d6bb12f0 (diff)
downloaddocutils-bb333974420adb61ffefe8d67ecb741a12be759a.tar.gz
Unify index handling and write the doc section about it.
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@5383 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'sandbox/py-rest-doc/sphinx/environment.py')
-rw-r--r--sandbox/py-rest-doc/sphinx/environment.py21
1 files changed, 13 insertions, 8 deletions
diff --git a/sandbox/py-rest-doc/sphinx/environment.py b/sandbox/py-rest-doc/sphinx/environment.py
index 1a9941a95..a70f5fb6f 100644
--- a/sandbox/py-rest-doc/sphinx/environment.py
+++ b/sandbox/py-rest-doc/sphinx/environment.py
@@ -643,8 +643,9 @@ class BuildEnvironment:
+ '#' + tid)
for fn, entries in self.indexentries.iteritems():
+ # new entry types must be listed in directives.py!
for type, string, tid, alias in entries:
- if type in ('single', 'ssingle'):
+ if type == 'single':
entry, _, subentry = string.partition('!')
add_entry(entry, subentry)
elif type == 'pair':
@@ -656,13 +657,14 @@ class BuildEnvironment:
add_entry(first, second+' '+third)
add_entry(second, third+', '+first)
add_entry(third, first+' '+second)
- elif type == 'quadruple':
- first, second, third, fourth = \
- map(lambda x: x.strip(), string.split(';', 3))
- add_entry(first, '%s %s %s' % (second, third, fourth))
- add_entry(second, '%s %s, %s' % (third, fourth, first))
- add_entry(third, '%s, %s %s' % (fourth, first, second))
- add_entry(fourth, '%s %s %s' % (first, second, third))
+# this is a bit ridiculous...
+# elif type == 'quadruple':
+# first, second, third, fourth = \
+# map(lambda x: x.strip(), string.split(';', 3))
+# add_entry(first, '%s %s %s' % (second, third, fourth))
+# add_entry(second, '%s %s, %s' % (third, fourth, first))
+# add_entry(third, '%s, %s %s' % (fourth, first, second))
+# add_entry(fourth, '%s %s %s' % (first, second, third))
elif type in ('module', 'keyword', 'operator', 'object',
'exception', 'statement'):
add_entry(string, type)
@@ -670,6 +672,9 @@ class BuildEnvironment:
elif type == 'builtin':
add_entry(string, 'built-in function')
add_entry('built-in function', string)
+ else:
+ print >>self.warning_stream, \
+ "unknown index entry type %r in %s" % (type, fn)
newlist = new.items()
newlist.sort(key=lambda t: t[0].lower())