MCPcopy Index your code
hub / github.com/python/cpython / index

Method index

Lib/pydoc.py:1176–1189  ·  view source on GitHub ↗

Generate an HTML index for a directory of modules.

(self, dir, shadowed=None)

Source from the content-addressed store, hash-verified

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

Callers 15

runMethod · 0.45
mainFunction · 0.45
parse_intFunction · 0.45
_strptimeFunction · 0.45
disFunction · 0.45
_replace_encodingFunction · 0.45
_as_int2Function · 0.45
formatyearMethod · 0.45
cert_time_to_secondsFunction · 0.45
compiler_fixupFunction · 0.45
html_indexFunction · 0.45
_clearstampMethod · 0.45

Calls 5

multicolumnMethod · 0.95
bigsectionMethod · 0.95
anyFunction · 0.70
appendMethod · 0.45
sortMethod · 0.45

Tested by

no test coverage detected