Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Side by Side Diff: third_party/twisted_8_1/twisted/lore/indexer.py

Issue 12261012: Remove third_party/twisted_8_1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 # Copyright (c) 2001-2004 Twisted Matrix Laboratories.
2 # See LICENSE for details.
3
4
5 def setIndexFilename(filename='index.xhtml'):
6 global indexFilename
7 indexFilename = filename
8
9 def getIndexFilename():
10 global indexFilename
11 return indexFilename
12
13 def addEntry(filename, anchor, text, reference):
14 global entries
15 if not entries.has_key(text):
16 entries[text] = []
17 entries[text].append((filename, anchor, reference))
18
19 def clearEntries():
20 global entries
21 entries = {}
22
23 def generateIndex():
24 global entries
25 global indexFilename
26
27 if not indexFilename:
28 return
29
30 f = open(indexFilename, 'w')
31 sortedEntries = [(e.lower(), e) for e in entries]
32 sortedEntries.sort()
33 sortedEntries = [e[1] for e in sortedEntries]
34 for text in sortedEntries:
35 refs = []
36 f.write(text.replace('!', ', ') + ': ')
37 for (file, anchor, reference) in entries[text]:
38 refs.append('<a href="%s#%s">%s</a>' % (file, anchor, reference))
39 if text == 'infinite recursion':
40 refs.append('<em>See Also:</em> recursion, infinite\n')
41 if text == 'recursion!infinite':
42 refs.append('<em>See Also:</em> infinite recursion\n')
43 f.write('%s<br />\n' % ", ".join(refs))
44 f.close()
45
46 def reset():
47 clearEntries()
48 setIndexFilename()
49
50 reset()
OLDNEW
« no previous file with comments | « third_party/twisted_8_1/twisted/lore/htmlbook.py ('k') | third_party/twisted_8_1/twisted/lore/latex.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698