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