MOBI Output: Fix regression that was preventing the creation of pagebreaks between the contents of different HTML files in the input.

This commit is contained in:
Kovid Goyal 2009-04-15 14:37:49 -07:00
parent c2b79fe5d9
commit d8430be7c8
2 changed files with 5 additions and 4 deletions

View File

@ -218,7 +218,7 @@ class Serializer(object):
for elem in item.data.find(XHTML('body')): for elem in item.data.find(XHTML('body')):
self.serialize_elem(elem, item) self.serialize_elem(elem, item)
#buffer.write('</mbp:section>') #buffer.write('</mbp:section>')
buffer.write('</mbp:pagebreak>') buffer.write('<mbp:pagebreak/>')
def serialize_elem(self, elem, item, nsrmap=NSRMAP): def serialize_elem(self, elem, item, nsrmap=NSRMAP):
buffer = self.buffer buffer = self.buffer

View File

@ -30,8 +30,8 @@ from calibre.gui2 import config as gui_conf
class CoverFetcher(QThread): class CoverFetcher(QThread):
def __init__(self, username, password, isbn, timeout, title, author): def __init__(self, username, password, isbn, timeout, title, author):
self.username = username self.username = username.strip() if username else username
self.password = password self.password = password.strip() if password else password
self.timeout = timeout self.timeout = timeout
self.isbn = isbn self.isbn = isbn
self.title = title self.title = title
@ -60,7 +60,8 @@ class CoverFetcher(QThread):
return return
self.isbn = results[0] 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] self.cover_data = cover_from_isbn(self.isbn, timeout=self.timeout)[0]
except Exception, e: except Exception, e:
self.exception = e self.exception = e