summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>1998-03-09 16:38:32 (GMT)
committerFred Drake <fdrake@acm.org>1998-03-09 16:38:32 (GMT)
commit568113a75b9b804f8d65e78219db2b2212541647 (patch)
treeeb3daad50a9dd79ece8b4d7748d7b3035ca4a0a8
parent8bc965785ee253e22502209b167661df270bc03c (diff)
downloadcpython-568113a75b9b804f8d65e78219db2b2212541647.zip
cpython-568113a75b9b804f8d65e78219db2b2212541647.tar.gz
cpython-568113a75b9b804f8d65e78219db2b2212541647.tar.bz2
Obsolete.
-rwxr-xr-xDoc/tools/modindex.py62
-rwxr-xr-xDoc/tools/newind.py22
2 files changed, 0 insertions, 84 deletions
diff --git a/Doc/tools/modindex.py b/Doc/tools/modindex.py
deleted file mode 100755
index 263f0bf..0000000
--- a/Doc/tools/modindex.py
+++ /dev/null
@@ -1,62 +0,0 @@
-#! /usr/bin/env python
-
-"""Script to convert raw module index data to module index."""
-
-import os
-import string
-import sys
-
-
-def parse_line(input):
- lineno = string.split(input)[-1]
- module = string.strip(input[:len(input)-(len(lineno)+1)])
- return module, lineno
-
-
-def cmp_items((s1, line1), (s2, line2)):
- rc = cmp(string.lower(s1), string.lower(s2))
- if rc == 0:
- # Make the lower-case version come first since the upper-case
- # version is usually a helper module for constants and such.
- rc = cmp(s2, s1)
- return rc
-
-
-
-def main():
- if sys.argv[1:]:
- infile = sys.argv[1]
- else:
- infile = "-"
- if infile == "-":
- ifp = sys.stdin
- ofp = sys.stdout
- sys.stdout = sys.stderr
- else:
- ifp = open(infile)
- base, ext = os.path.splitext(infile)
- outfile = base + ".ind"
- ofp = open(outfile, "w")
- ofp.write("\\begin{theindex}\n\n")
- lines = ifp.readlines()
- for i in range(len(lines)):
- if lines[i][0] == '\\':
- lines[i] = '\1' + lines[i]
- lines = map(parse_line, lines)
- lines.sort(cmp_items)
- prev_letter = lines[0][0][0]
- if prev_letter == '\1':
- prev_letter = lines[0][0][1]
- prev_letter = string.lower(prev_letter)
- for module, lineno in lines:
- if module[0] == '\1':
- module = module[1:]
- if string.lower(module[0]) != prev_letter:
- ofp.write("\n \\indexspace\n\n")
- prev_letter = string.lower(module[0])
- ofp.write(" \\item {\\tt %s}, %s\n" % (module, lineno))
- ofp.write("\n\\end{theindex}\n")
-
-
-if __name__ == "__main__":
- main()
diff --git a/Doc/tools/newind.py b/Doc/tools/newind.py
deleted file mode 100755
index b3a263b..0000000
--- a/Doc/tools/newind.py
+++ /dev/null
@@ -1,22 +0,0 @@
-#! /usr/bin/env python
-
-"""Really nasty little script to create an empty, labeled index on stdout.
-
-Do it this way since some shells seem to work badly (and differently) with
-the leading '\b' for the first output line. Specifically, /bin/sh on
-Solaris doesn't seem to get it right. Once the quoting works there, it
-doesn't work on Linux any more. ;-(
-"""
-__version__ = '$Revision$'
-# $Source$
-
-import sys
-
-if sys.argv[1:]:
- label = sys.argv[1]
-else:
- label = "genindex"
-
-print "\\begin{theindex}"
-print "\\label{%s}" % label
-print "\\end{theindex}"