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