MCPcopy Create free account
hub / github.com/LabPy/lantz / list_packages

Function list_packages

docs/driversdoc.py:307–321  ·  view source on GitHub ↗
(root_package)

Source from the content-addressed store, hash-verified

305 return buf.getvalue()
306
307def list_packages(root_package):
308 packages = {}
309 failed_packages = []
310 path, prefix = root_package.__path__, root_package.__name__ + "."
311 for importer, modname, ispkg in pkgutil.iter_modules(path, prefix):
312 if not ispkg:
313 continue
314 try:
315 package = __import__(modname, fromlist="dummy")
316 packages[package.__name__] = package
317 print('+ Imported {}'.format(modname))
318 except Exception as e:
319 failed_packages.append(modname)
320 print('- Cannot import {}: {}'.format(modname, e))
321 return packages, failed_packages
322
323def main():
324 print('\nGenerating documentation for drivers ...')

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected