fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Minor css fix.
[wolnelektury.git]
/
src
/
catalogue
/
utils.py
diff --git
a/src/catalogue/utils.py
b/src/catalogue/utils.py
index
916fd70
..
9461243
100644
(file)
--- a/
src/catalogue/utils.py
+++ b/
src/catalogue/utils.py
@@
-97,7
+97,7
@@
class LockFile(object):
# @task
# @task
-def create_zip(paths, zip_slug):
+def create_zip(paths, zip_slug
, file_contents=None
):
"""
Creates a zip in MEDIA_ROOT/zip directory containing files from path.
Resulting archive filename is ${zip_slug}.zip
"""
Creates a zip in MEDIA_ROOT/zip directory containing files from path.
Resulting archive filename is ${zip_slug}.zip
@@
-121,6
+121,9
@@
def create_zip(paths, zip_slug):
if arcname is None:
arcname = path.basename(p)
zipf.write(p, arcname)
if arcname is None:
arcname = path.basename(p)
zipf.write(p, arcname)
+ if file_contents:
+ for arcname, content in file_contents.items():
+ zipf.writestr(arcname, content)
finally:
zipf.close()
finally:
zipf.close()