frame margins in epub/mobi
[librarian.git] / librarian / text.py
index e19716e..4064849 100644 (file)
@@ -26,7 +26,7 @@ Utwór opracowany został w ramach projektu Wolne Lektury przez fundację Nowocz
 
 %(license_description)s.%(source)s%(publisher)s
 
-%(description)s%(contributors)s%(funders)s
+%(description)s%(contributors)s%(funders)s%(isbn)s
 """
 
 
@@ -60,7 +60,7 @@ def transform(wldoc, flags=None, **options):
             license_description = parsed_dc.license_description
             license = parsed_dc.license
             if license:
-                license_description = u"Ten utwór jest udostepniony na licencji %s: \n%s" % (
+                license_description = u"Ten utwór jest udostępniony na licencji %s: \n%s" % (
                     license_description, license)
             else:
                 license_description = u"Ten utwór nie jest objęty majątkowym prawem autorskim i znajduje się " \
@@ -83,8 +83,13 @@ def transform(wldoc, flags=None, **options):
                 contributors = "\n\nOpracowanie redakcyjne i przypisy: %s." % contributors
             funders = ', '.join(parsed_dc.funders)
             if funders:
-                funders = u"\n\nPublikację ufundowali i ufundowały: %s." % funders
+                funders = u"\n\nPublikację wsparli i wsparły: %s." % funders
             publisher = '\n\nWydawca: ' + ', '.join(parsed_dc.publisher)
+            isbn = getattr(parsed_dc, 'isbn_txt', None)
+            if isbn:
+                isbn = '\n\n' + isbn
+            else:
+                isbn = ''
         else:
             description = 'Publikacja zrealizowana w ramach projektu Wolne Lektury (http://wolnelektury.pl).'
             url = '*' * 10
@@ -93,6 +98,7 @@ def transform(wldoc, flags=None, **options):
             contributors = ""
             funders = ""
             publisher = ""
+            isbn = ""
         result = (TEMPLATE % {
             'description': description,
             'url': url,
@@ -102,6 +108,7 @@ def transform(wldoc, flags=None, **options):
             'contributors': contributors,
             'funders': funders,
             'publisher': publisher,
+            'isbn': isbn,
         }).encode('utf-8')
     else:
         result = unicode(result).encode('utf-8')