Generate an HTML index for a directory of modules.
(self, dir, shadowed=None)
| 1174 | return lhs + self.repr(object) |
| 1175 | |
| 1176 | def index(self, dir, shadowed=None): |
| 1177 | """Generate an HTML index for a directory of modules.""" |
| 1178 | modpkgs = [] |
| 1179 | if shadowed is None: shadowed = {} |
| 1180 | for importer, name, ispkg in pkgutil.iter_modules([dir]): |
| 1181 | if any((0xD800 <= ord(ch) <= 0xDFFF) for ch in name): |
| 1182 | # ignore a module if its name contains a surrogate character |
| 1183 | continue |
| 1184 | modpkgs.append((name, '', ispkg, name in shadowed)) |
| 1185 | shadowed[name] = 1 |
| 1186 | |
| 1187 | modpkgs.sort() |
| 1188 | contents = self.multicolumn(modpkgs, self.modpkglink) |
| 1189 | return self.bigsection(dir, 'index', contents) |
| 1190 | |
| 1191 | # -------------------------------------------- text documentation generator |
| 1192 |
no test coverage detected