MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / listmodules

Method listmodules

tools/python-3.11.9-amd64/Lib/pydoc.py:2276–2302  ·  view source on GitHub ↗
(self, key='')

Source from the content-addressed store, hash-verified

2274 self.showtopic(topic, xrefs)
2275
2276 def listmodules(self, key=''):
2277 if key:
2278 self.output.write('''
2279Here is a list of modules whose name or summary contains '{}'.
2280If there are any, enter a module name to get more help.
2281
2282'''.format(key))
2283 apropos(key)
2284 else:
2285 self.output.write('''
2286Please wait a moment while I gather a list of all available modules...
2287
2288''')
2289 modules = {}
2290 def callback(path, modname, desc, modules=modules):
2291 if modname and modname[-9:] == '.__init__':
2292 modname = modname[:-9] + ' (package)'
2293 if modname.find('.') < 0:
2294 modules[modname] = 1
2295 def onerror(modname):
2296 callback(None, modname, None)
2297 ModuleScanner().run(callback, onerror=onerror)
2298 self.list(modules.keys())
2299 self.output.write(''&#x27;
2300Enter any module name to get more help. Or, type "modules spam" to search
2301for modules whose name or summary contain the string "spam".
2302''&#x27;)
2303
2304help = Helper()
2305

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