2 # -*- coding: utf-8 -*-
3 # This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later.
4 # Copyright © Fundacja Wolne Lektury. See NOTICE for more information.
11 sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../src'))
13 os.environ.setdefault("DJANGO_SETTINGS_MODULE", "wolnelektury.settings")
16 from catalogue.models import Book
20 print "Provide a zip name as first argument"
23 zip = zipfile.ZipFile(sys.argv[1], 'w')
24 for book in Book.objects.all():
25 zip.write(book.xml_file.path, "%s.xml" % book.slug)