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, '../wolnelektury')
11 sys.path.insert(0, '..')
13 from django.core.management import setup_environ
14 from wolnelektury import settings
18 setup_environ(settings)
20 from catalogue.models import Book
24 print "Provide a zip name as first argument"
27 zip = zipfile.ZipFile(sys.argv[1], 'w')
28 for book in Book.objects.all():
29 zip.write(book.xml_file.path, "%s.xml" % book.slug)