1 #!/usr/bin/env python 2 3 if __name__ == "__main__": 4 import sys, os 5 sys.setrecursionlimit(10000) 6 7 import simplified 8 9 if "-s" in sys.argv: 10 simplified.set_single_instance_mode() 11 elif "-m" in sys.argv: 12 simplified.set_multiple_instance_mode() 13 14 import viewer 15 from annotate import AnnotationError, Importer, load 16 17 importer = Importer(sys.path) 18 try: 19 builtins = load(os.path.join("lib", "builtins.py")) 20 module = load(sys.argv[1], builtins, None, importer) 21 except AnnotationError, exc: 22 raise 23 else: 24 if "-d" in sys.argv: 25 viewer.makedocs(module, importer.modules.values(), builtins) 26 27 # vim: tabstop=4 expandtab shiftwidth=4