Apparently the code to forestall Tk eating events was too aggressive (Tk user input...
[python/dscho.git] / Tools / compiler / compile.py
blob58fc3b2c6d6685b5940c53199dc54435645f0848
1 import sys
2 import getopt
4 from compiler import compile, visitor
6 def main():
7 VERBOSE = 0
8 DISPLAY = 0
9 opts, args = getopt.getopt(sys.argv[1:], 'vqd')
10 for k, v in opts:
11 if k == '-v':
12 VERBOSE = 1
13 visitor.ASTVisitor.VERBOSE = visitor.ASTVisitor.VERBOSE + 1
14 if k == '-q':
15 if sys.platform[:3]=="win":
16 f = open('nul', 'wb') # /dev/null fails on Windows...
17 else:
18 f = open('/dev/null', 'wb')
19 sys.stdout = f
20 if k == '-d':
21 DISPLAY = 1
22 if not args:
23 print "no files to compile"
24 else:
25 for filename in args:
26 if VERBOSE:
27 print filename
28 compile(filename, DISPLAY)
30 if __name__ == "__main__":
31 main()