2006-12-09 | paulb | raw annotate files changeset graph | Fixed/improved module naming. Introduced a dictionary of imported modules. Fixed aliases used with import-related statements so that the bottommost module is associated with (or used to obtain) aliases, not the uppermost module. Added tests of packages. |
1 #!/usr/bin/env python 2 3 import sys, os 4 import viewer 5 from annotate import AnnotationError, Importer, load 6 7 if __name__ == "__main__": 8 9 importer = Importer(sys.path) 10 try: 11 builtins = load(os.path.join("lib", "builtins.py")) 12 module = load(sys.argv[1], builtins, None, importer) 13 except AnnotationError, exc: 14 raise 15 else: 16 if "-d" in sys.argv: 17 viewer.makedocs(module, importer.modules.values(), builtins) 18 19 # vim: tabstop=4 expandtab shiftwidth=4