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