Table of Contents
main(): The main program
checkArguments(): Digest the command line arguments
fatal(): Fatal error
buildKwic(): Survey the users and build the KWIC index
genWebUsers(): Find users with homepages
genAllUsers(): Find all the users in LDAP
isWebUser(): Does this user have a personal Web?
indexUser(): Add one user to the KWIC index
buildAllPages(): Build the output pages
scanInitialLetters(): What initial letters occur in keywords?
buildIndexPage(): Build the top-level page
relToURL(): URL of a relative path
relToAbs(): Absolute path from a relative path
addSubpageLink(): Link from the index page to one subpage
letterInfo(): Information about a subpage
buildSubpage(): Build the subpage for one letter
emptySubpage(): Set up an empty subpage
addRow(): Add one row to the subpage table
class WebUser: Encapsulate user data
Everyone who has an account at the New Mexico Tech (NMT)
Computer Center (TCC) may host a personal homepage with a
URL of the form
is the user's login name.
The purpose of this project is to generate an index to all these homepages so that other members of the NMT community can find them.
Typically people will know either the given name or surname of the person they are looking for. Some campus clubs and other organizations also have homepages.
One venerable technology for automatically generating
indexes is KeyWord In Context (KWIC) indexing. This
technique is discussed in a related TCC publication,
Python module to generate a Key Word In Context (KWIC)
index. This publication discusses
how such indexes are structured.
Accordingly, this project provides a script that can be run periodically as a cron job. When run, the script generates a set of pages that index the current personal homepages. Each homepage is indexed using the words in the accountholder's Gecos field in the TCC's LDAP server that defines the attributes of their user account.
The top-level page describes the overall structure of the index, and provides a link for each letter of the alphabet.
For each letter of the alphabet, a subpage contains all the index entries for words starting with that letter.