mirror of
https://github.com/Relintai/pandemonium_engine_easy_charts.git
synced 2024-12-17 13:26:52 +01:00
This commit is contained in:
parent
46a85d3181
commit
50447bddae
@ -1,19 +0,0 @@
|
||||
import glob,zipfile,shutil,os,sys,tarfile
|
||||
|
||||
archive = sys.argv[1]
|
||||
destination = sys.argv[2]
|
||||
|
||||
if archive.endswith('.zip'):
|
||||
with zipfile.ZipFile(archive) as zip:
|
||||
for zip_info in zip.infolist():
|
||||
if zip_info.filename == zip.infolist()[0].filename :
|
||||
continue
|
||||
zip_info.filename = zip_info.filename.replace(zip.infolist()[0].filename,'')
|
||||
zip_info.filename.replace(zip.infolist()[0].filename,'')
|
||||
elif archive.endswith('.tar.gz'):
|
||||
tar = tarfile.open(archive)
|
||||
for member in tar.getmembers():
|
||||
if member.name == tar.getmembers()[0].name:
|
||||
continue
|
||||
member.name = member.name.replace(tar.getmembers()[0].name+'/','')
|
||||
tar.extract(member, destination)
|
Loading…
Reference in New Issue
Block a user