uncompress için bz2 desteği de ekle
This commit is contained in:
+4
-4
@@ -215,14 +215,14 @@ def uncompress(patchFile, compressType="gz", targetDir=None):
|
|||||||
else:
|
else:
|
||||||
filePath = os.path.basename(patchFile)
|
filePath = os.path.basename(patchFile)
|
||||||
|
|
||||||
fileObj = open(filePath, "w")
|
|
||||||
|
|
||||||
if compressType == "gz":
|
if compressType == "gz":
|
||||||
from gzip import GzipFile
|
from gzip import GzipFile
|
||||||
obj = GzipFile(patchFile)
|
obj = GzipFile(patchFile)
|
||||||
|
else if compressType = "bz2":
|
||||||
|
from bz2 import BZ2File
|
||||||
|
obj = BZ2File(patchFile)
|
||||||
|
|
||||||
fileObj.write(obj.read())
|
open(filePath, "w").write(obj.read())
|
||||||
fileObj.close()
|
|
||||||
return filePath
|
return filePath
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user