def main(): print 'wdiff: warning: this program does NOT make backups' argv = sys.argv flags = '' if len(argv) >= 2 and argv[1][:1] == '-': flags = argv[1] del argv[1] m = mainmenu() # Create menu earlier than windows if len(argv) == 2: # 1 argument w = anyopen(argv[1]) if not w: return elif len(argv) == 3: # 2 arguments w = anydiff(argv[1], argv[2], flags) w.parent = () else: sys.stdout = sys.stderr print 'usage:', argv[0], '[diff-flags] dir-1 [dir-2]' sys.exit(2) del w # It's preserved in gwin.windows while 1: try: gwin.mainloop() break except KeyboardInterrupt: pass # Just continue...
def main(): print "wdiff: warning: this program does NOT make backups" argv = sys.argv flags = "" if len(argv) >= 2 and argv[1][:1] == "-": flags = argv[1] del argv[1] stdwin.setdefscrollbars(0, 1) m = mainmenu() # Create menu earlier than windows if len(argv) == 2: # 1 argument w = anyopen(argv[1]) if not w: return elif len(argv) == 3: # 2 arguments w = anydiff(argv[1], argv[2], flags) w.parent = () else: sys.stdout = sys.stderr print "usage:", argv[0], "[diff-flags] dir-1 [dir-2]" sys.exit(2) del w # It's preserved in gwin.windows while 1: try: gwin.mainloop() break except KeyboardInterrupt: pass # Just continue...
def demo(): # Demonstration da = demo_action # shorthand col0 = [('a1', da), ('bbb1', da), ('c1', da)] col1 = [('a2', da), ('bbb2', da)] col2 = [('a3', da), ('b3', da), ('c3', da), ('d4', da), ('d5', da)] col3 = [] for i in range(1, 31): col3.append('xxx' + `i`, da) data = [col0, col1, col2, col3] w = open('tablewin.demo', data) gwin.mainloop() return w
# Main function def main(): print 'wdiff: warning: this version does NOT yet make backups' argv = sys.argv flags = '' if len(argv) >= 2 and argv[1][:1] = '-': flags = argv[1] del argv[1] m = mainmenu() # Create menu earlier than windows if len(argv) = 2: # 1 argument w = anyopen(argv[1]) if not w: return elif len(argv) = 3: # 2 arguments w = anydiff(argv[1], argv[2], flags) w.parent = () else: sys.stdout = sys.stderr print 'usage:', argv[0], '[diff-flags] dir-1 [dir-2]' sys.exit(2) del w # It's preserved in gwin.windows while 1: try: gwin.mainloop() break except KeyboardInterrupt: pass # Just continue... # Start the main function (this is a script) main()