mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-18 23:45:52 +08:00
Update file.py
This commit is contained in:
+4
-1
@@ -147,7 +147,7 @@ def uncompress(sfile, dfile, path):
|
|||||||
if suffix_gz == tar_gz:
|
if suffix_gz == tar_gz:
|
||||||
extension = suffix_gz
|
extension = suffix_gz
|
||||||
|
|
||||||
if not extension in ['tar.gz', 'gz', 'zip', 'rar', '7z', 'xz','bz2']:
|
if not extension in ['tar.gz', 'tgz','gz', 'zip', 'rar', '7z', 'xz','bz2']:
|
||||||
return mw.returnData(False, '现在仅支持gz,zip,rar,7z,xz,bz2格式解压!')
|
return mw.returnData(False, '现在仅支持gz,zip,rar,7z,xz,bz2格式解压!')
|
||||||
|
|
||||||
if extension == 'rar' and not mw.checkBinExist('rar'):
|
if extension == 'rar' and not mw.checkBinExist('rar'):
|
||||||
@@ -165,6 +165,9 @@ def uncompress(sfile, dfile, path):
|
|||||||
elif extension == 'tar.gz':
|
elif extension == 'tar.gz':
|
||||||
cmd += "&& tar -zxvf " + sfile + " -C " + dfile + " > " + tmps + " 2>&1 &"
|
cmd += "&& tar -zxvf " + sfile + " -C " + dfile + " > " + tmps + " 2>&1 &"
|
||||||
mw.execShell(cmd)
|
mw.execShell(cmd)
|
||||||
|
elif extension == 'tgz':
|
||||||
|
cmd += "&& tar -zxvf " + sfile + " -C " + dfile + " > " + tmps + " 2>&1 &"
|
||||||
|
mw.execShell(cmd)
|
||||||
elif extension == 'gz':
|
elif extension == 'gz':
|
||||||
cmd += "&& gunzip -k " + sfile + " > " + tmps + " 2>&1 &"
|
cmd += "&& gunzip -k " + sfile + " > " + tmps + " 2>&1 &"
|
||||||
mw.execShell(cmd)
|
mw.execShell(cmd)
|
||||||
|
|||||||
Reference in New Issue
Block a user