Source code for install.bzip2_tool
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2009 Glencoe Software, Inc. All rights reserved.
# Use is subject to license terms supplied in LICENSE.txt
"""
Function for enabling/disabling the bzip2.dll which
comes with PyTables.
"""
import os
import sys
def _swap(f, t):
if not os.path.exists(f):
print("%s doesn't exist" % f)
sys.exit(0)
os.rename(f, t)
if __name__ == "__main__":
try:
if len(sys.argv) == 2:
which = sys.argv[1]
if which == "disable":
which = True
elif which == "enable":
which = False
else:
print("Unknown command: ", which)
sys.exit(2)
bzip2_tool(disable=which)
sys.exit(0)
except Exception as e:
print("bzip2_tool failed: ", e)
sys.exit(1)
print("Usage: %s disable|enable" % sys.argv[0])
sys.exit(2)