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

Method report

Lib/modulefinder.py:496–528  ·  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

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