uncompress için bz2 desteği de ekle

This commit is contained in:
Barış Metin
2005-07-01 13:05:45 +00:00
parent 0b76504d83
commit 61472608ce
+4 -4
View File
@@ -215,14 +215,14 @@ def uncompress(patchFile, compressType="gz", targetDir=None):
else:
filePath = os.path.basename(patchFile)
fileObj = open(filePath, "w")
if compressType == "gz":
from gzip import GzipFile
obj = GzipFile(patchFile)
else if compressType = "bz2":
from bz2 import BZ2File
obj = BZ2File(patchFile)
fileObj.write(obj.read())
fileObj.close()
open(filePath, "w").write(obj.read())
return filePath