1 #!/usr/bin/env python 2 3 import micropython 4 import sys 5 6 def show(importer): 7 for i, x in enumerate(importer.get_image()): 8 print i, x 9 10 i = micropython.Importer(sys.path, "-v" in sys.argv) 11 try: 12 if len(sys.argv) < 2: 13 m = i.load("micropython") 14 #m = i.load_from_file("micropython/__init__.py") 15 else: 16 m = i.load_from_file(sys.argv[1]) 17 except micropython.InspectError, exc: 18 print "At line", exc.node.lineno, "the following error occurred:" 19 print exc.message 20 else: 21 i.vacuum() 22 ot = i.get_object_table() 23 pt = i.get_parameter_table() 24 25 # vim: tabstop=4 expandtab shiftwidth=4