2 # -*- coding: utf-8 -*-
3 # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
4 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
7 sys.path.insert(0, '../apps')
8 sys.path.insert(0, '../lib')
9 sys.path.insert(0, '../lib/librarian')
10 sys.path.insert(0, '..')
12 from django.core.management import setup_environ
13 from wolnelektury import settings
17 setup_environ(settings)
19 from catalogue.models import Book
23 print "Provide a zip name as first argument"
26 zip = zipfile.ZipFile(sys.argv[1], 'w')
27 for book in Book.objects.all():
28 zip.write(book.xml_file.path, "%s.xml" % book.slug)