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)
| 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 |