'Generate an HTML index for a directory of modules.'

def index(self, dir, shadowed=None):

    modpkgs = []
    if (shadowed is None):
        shadowed = {}
    for (importer, name, ispkg) in pkgutil.iter_modules([dir]):
        modpkgs.append((name, '', ispkg, (name in shadowed)))
        shadowed[name] = 1
    modpkgs.sort()
    contents = self.multicolumn(modpkgs, self.modpkglink)
    return self.bigsection(dir, '#ffffff', '#ee77aa', contents)
