1
2
3
4 """
5
6 Function for enabling/disabling the bzip2.dll which
7 comes with PyTables.
8
9 Copyright 2009 Glencoe Software, Inc. All rights reserved.
10 Use is subject to license terms supplied in LICENSE.txt
11
12 """
13
14 import os, sys
15
31
33 if not os.path.exists(f):
34 print "%s doesn't exist" % f
35 sys.exit(0)
36 os.rename(f, t)
37
38 if __name__ == "__main__":
39 try:
40 if len(sys.argv) == 2:
41 which = sys.argv[1]
42 if which == "disable":
43 which = True
44 elif which == "enable":
45 which = False
46 else:
47 print "Unknown command: ", which
48 sys.exit(2)
49 bzip2_tool(disable=which)
50 sys.exit(0)
51 except Exception, e:
52 print "bzip2_tool failed: ", e
53 sys.exit(1)
54
55 print "Usage: %s disable|enable" % sys.argv[0]
56 sys.exit(2)
57