From d8430be7c84815b6e2b2003088f0bb6cbbb3596c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 15 Apr 2009 14:37:49 -0700 Subject: [PATCH] MOBI Output: Fix regression that was preventing the creation of pagebreaks between the contents of different HTML files in the input. --- src/calibre/ebooks/mobi/writer.py | 2 +- src/calibre/gui2/dialogs/metadata_single.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/calibre/ebooks/mobi/writer.py b/src/calibre/ebooks/mobi/writer.py index 9990fa9061..c860a9418e 100644 --- a/src/calibre/ebooks/mobi/writer.py +++ b/src/calibre/ebooks/mobi/writer.py @@ -218,7 +218,7 @@ class Serializer(object): for elem in item.data.find(XHTML('body')): self.serialize_elem(elem, item) #buffer.write('') - buffer.write('') + buffer.write('') def serialize_elem(self, elem, item, nsrmap=NSRMAP): buffer = self.buffer diff --git a/src/calibre/gui2/dialogs/metadata_single.py b/src/calibre/gui2/dialogs/metadata_single.py index e3d4b5b521..c48c7c3640 100644 --- a/src/calibre/gui2/dialogs/metadata_single.py +++ b/src/calibre/gui2/dialogs/metadata_single.py @@ -30,8 +30,8 @@ from calibre.gui2 import config as gui_conf class CoverFetcher(QThread): def __init__(self, username, password, isbn, timeout, title, author): - self.username = username - self.password = password + self.username = username.strip() if username else username + self.password = password.strip() if password else password self.timeout = timeout self.isbn = isbn self.title = title @@ -60,7 +60,8 @@ class CoverFetcher(QThread): return self.isbn = results[0] - login(self.username, self.password, force=False) + if self.username and self.password: + login(self.username, self.password, force=False) self.cover_data = cover_from_isbn(self.isbn, timeout=self.timeout)[0] except Exception, e: self.exception = e