MCPcopy Index your code
hub / github.com/RustPython/RustPython / listmodules

Method listmodules

Lib/pydoc.py:2228–2254  ·  view source on GitHub ↗
(self, key='')

Source from the content-addressed store, hash-verified

2226 self.showtopic(topic, xrefs)
2227
2228 def listmodules(self, key=''):
2229 if key:
2230 self.output.write('''
2231Here is a list of modules whose name or summary contains '{}'.
2232If there are any, enter a module name to get more help.
2233
2234'''.format(key))
2235 apropos(key)
2236 else:
2237 self.output.write('''
2238Please wait a moment while I gather a list of all available modules...
2239
2240''')
2241 modules = {}
2242 def callback(path, modname, desc, modules=modules):
2243 if modname and modname[-9:] == '.__init__':
2244 modname = modname[:-9] + ' (package)'
2245 if modname.find('.') < 0:
2246 modules[modname] = 1
2247 def onerror(modname):
2248 callback(None, modname, None)
2249 ModuleScanner().run(callback, onerror=onerror)
2250 self.list(modules.keys())
2251 self.output.write(''&#x27;
2252Enter any module name to get more help. Or, type "modules spam" to search
2253for modules whose name or summary contain the string "spam".
2254''&#x27;)
2255
2256help = Helper()
2257

Callers 1

helpMethod · 0.95

Calls 7

listMethod · 0.95
aproposFunction · 0.85
ModuleScannerClass · 0.85
writeMethod · 0.45
formatMethod · 0.45
runMethod · 0.45
keysMethod · 0.45

Tested by

no test coverage detected