Next comes a few import
statements to bring in the various Python modules we
need.
Since we're using Python generators, a relatively new feature, we have to import generators as a “future” feature before doing any other imports.
#================================================================ # Imports #---------------------------------------------------------------- from __future__ import generators # Allow generators
The sys module contains the
standard I/O streams such as sys.stdout, the standard output stream.
import sys
The Python ldap module
handles communication with the LDAP server. For more
information, see LDAP
client API for Python.
import ldap
The os module allows us to
access Posix file systems so we can check for
readable homepages. The related stat module is used for interpreting
status values from a directory entry.
import os import stat
The Python time module is
needed so we can timestamp the output.
import time
The xmlcreate.py module is a
package for XML file generation. Its interface is
described in Python and the XML Document Object Model
(DOM).
import xmlcreate as xc