Next / Previous / Contents / TCC Help System / NM Tech homepage

6. Imported modules

Here we import the modules used by this application.

# - - - - -   I m p o r t s

We need sys for access to the command line and the standard I/O streams. We'll also need the standard os and stat modules to look for directories and files and determine their permissions.

import sys
import os
import stat

Python's LDAP interface comes from a SourceForge site.

import ldap

The kwic module builds the KWIC index.

import kwic

The tccpage2 module handles generation of TCC pages with the standard appearance. Because we use this name in lots of places, we'll shorten it to tp.

import tccpage2 as tp

To work with the tccpage2 module, we'll use the XML generation technique described in Python XML processing with lxml. We'll refer to this ElementTree implementation as et for short; E is the element factory; subElement() adds a child node; and addText() adds text to an existing node.

from etbuilder import et, E, subElement, addText