2 # -*- coding: utf-8 -*-
4 # This file is part of Librarian, licensed under GNU Affero GPLv3 or later.
5 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
7 from StringIO import StringIO
8 from librarian import OutputFile
9 from librarian.book2anything import Book2Anything, Option
12 class Book2Cover(Book2Anything):
16 cover_optional = False
19 def transform(wldoc, cover):
21 cover(wldoc.book_info).save(output)
22 return OutputFile.from_string(output.getvalue())
25 if __name__ == '__main__':