mirror of
https://github.com/keanuplayz/dotfiles.git
synced 2024-08-15 02:33:12 +00:00
[scripts/wastickers] Fixed paths and enabled compression
This commit is contained in:
parent
1675c8174a
commit
6715440edc
1 changed files with 4 additions and 3 deletions
|
@ -5,7 +5,7 @@ import subprocess
|
|||
from glob import glob
|
||||
import time
|
||||
import pathlib
|
||||
from zipfile import ZipFile
|
||||
from zipfile import ZipFile, ZIP_STORED
|
||||
|
||||
cwd = os.getcwd()
|
||||
pathlib.Path(f'./tmp').mkdir(parents=True, exist_ok=True)
|
||||
|
@ -45,10 +45,11 @@ for file in files:
|
|||
time.sleep(1)
|
||||
|
||||
files = glob('./*')
|
||||
with ZipFile(f'{pname}.wastickers', 'w') as zip:
|
||||
with ZipFile(f'{pname}.wastickers', 'w', ZIP_STORED) as zip:
|
||||
for file in files:
|
||||
zipfilename = file.replace('./', '/')
|
||||
with open(file, 'rb') as image_file:
|
||||
zip.writestr(f"/{file}", image_file.read())
|
||||
zip.writestr(f"{zipfilename}", image_file.read())
|
||||
|
||||
os.chdir(cwd)
|
||||
copyfile(f'./tmp/{pname}.wastickers', f'./{pname}.wastickers')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue