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

Method report

tools/python-3.11.9-amd64/Lib/modulefinder.py:491–523  ·  view source on GitHub ↗

Print a report to stdout, listing the found modules with their paths, as well as modules that are missing, or seem to be missing.

(self)

Source from the content-addressed store, hash-verified

489 return _find_module(name, path)
490
491 def report(self):
492 """Print a report to stdout, listing the found modules with their
493 paths, as well as modules that are missing, or seem to be missing.
494 """
495 print()
496 print(" %-25s %s" % ("Name", "File"))
497 print(" %-25s %s" % ("----", "----"))
498 # Print modules found
499 keys = sorted(self.modules.keys())
500 for key in keys:
501 m = self.modules[key]
502 if m.__path__:
503 print("P", end=' ')
504 else:
505 print("m", end=' ')
506 print("%-25s" % key, m.__file__ or "")
507
508 # Print missing modules
509 missing, maybe = self.any_missing_maybe()
510 if missing:
511 print()
512 print("Missing modules:")
513 for name in missing:
514 mods = sorted(self.badmodules[name].keys())
515 print("?", name, "imported from", ', '.join(mods))
516 # Print modules that may be missing, but then again, maybe not...
517 if maybe:
518 print()
519 print("Submodules that appear to be missing, but could also be", end=' ')
520 print("global names in the parent package:")
521 for name in maybe:
522 mods = sorted(self.badmodules[name].keys())
523 print("?", name, "imported from", ', '.join(mods))
524
525 def any_missing(self):
526 """Return a list of modules that appear to be missing. Use

Callers 1

testFunction · 0.95

Calls 5

any_missing_maybeMethod · 0.95
sortedFunction · 0.85
printFunction · 0.50
keysMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected