diff --git a/src/calibre/ebooks/fb2/fb2ml.py b/src/calibre/ebooks/fb2/fb2ml.py index 75c03aedc2..79a2c10a62 100644 --- a/src/calibre/ebooks/fb2/fb2ml.py +++ b/src/calibre/ebooks/fb2/fb2ml.py @@ -8,10 +8,9 @@ __docformat__ = 'restructuredtext en' Transform OEB content into FB2 markup ''' +import re, textwrap, uuid from base64 import b64encode from datetime import datetime -import re -import uuid from lxml import etree @@ -165,28 +164,29 @@ class FB2MLizer(object): if key not in ('author', 'cover', 'sequence', 'keywords'): metadata[key] = prepare_string_for_xml(value) - return (u'' - '' - '' - '%(genre)s' - '%(author)s' - '%(title)s' - '%(cover)s' - '%(lang)s' - '%(keywords)s' - '%(sequence)s' - '' - '' - '%(author)s' - '%(appname)s %(version)s' - '%(date)s' - '%(id)s' - '1.0' - '' - '') % metadata + return textwrap.dedent(u''' + + + + %(genre)s + %(author)s + %(title)s + %(cover)s + %(lang)s + %(keywords)s + %(sequence)s + + + %(author)s + %(appname)s %(version)s + %(date)s + %(id)s + 1.0 + + \n''') % metadata def fb2_footer(self): - return u'' + return u'\n' def get_cover(self): from calibre.ebooks.oeb.base import OEB_RASTER_IMAGES