2 # based on http://doeidoei.wordpress.com/2010/11/23/compressing-files-with-python-symlink-trouble/
3 import os
, sys
, zipfile
6 usage: find . -name \*.jpg -or -name \*.png -print0 | python cbzl.py curimgs.cbz
7 or: locate -0 .jpg | python cbzl.py alljpegs.cbz
10 if len (sys
.argv
) < 2:
14 with zipfile
.ZipFile (sys
.argv
[1], "w") as z
:
15 zerosep
= sys
.stdin
.read ()
16 files
= zerosep
.split ('\0')
18 a
= zipfile
.ZipInfo ()
19 a
.filename
= os
.path
.basename (name
)
21 a
.external_attr
= 2716663808