From 8a09a4db03ae33cbdf90d56bd5e018e9e000ceb7 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 29 Apr 2013 07:33:41 +0530 Subject: [PATCH] FB2 Output: Properly indent the metadata header. --- src/calibre/ebooks/fb2/fb2ml.py | 44 ++++++++++++++++----------------- 1 file changed, 22 insertions(+), 22 deletions(-) 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