#! /usr/bin/env python # -*- Python -*- """usage: %(program)s [options] file... Supported options: --address addr -a addr Set the address text to include at the end of the generated HTML; this should be used for contact information. --columns cols -c cols Set the number of columns each index section should be displayed in. The default is 1. --help -h Display this help message. --letters -l Split the output into sections by letter. --output file -o file Write output to 'file' instead of standard out. --iconserver is Use 'is' as the directory containing icons for the navigation bar. The default is 'icons'. --title str Set the page title to 'str'. The default is 'Global Module Index'. --uplink url Set the upward link URL. The default is './'. --uptitle str Set the upward link title. The default is 'Python Documentation Index'. """ import buildindex import os import re import string import support import sys class IndexOptions(support.Options): def __init__(self): support.Options.__init__(self) self.add_args("l", ["letters"]) self.letters = 0 def handle_option(self, opt, val): if opt in ("-l", "--letters"): self.letters = 1 def usage(self): program = os.path.basename(sys.argv[0]) print __doc__ % {"program": program} class Node(buildindex.Node): annotation = "" def __init__(self, link, str, seqno): parts = string.split(str, None, 1) if parts[0][-5:] == "": self.modname = parts[0][:-5] else: self.modname = parts[0] if len(parts) == 2: self.annotation = parts[1] buildindex.Node.__init__(self, link, self.modname, seqno) def __str__(self): return '%s %s' \ % (self.modname, self.annotation) _rx = re.compile( "
Some module names are followed by an annotation indicating what platform they are available on.
""" if __name__ == "__main__": main()