From a9a9d8f4ba857d0d6c8fdcf13d2abcf7449a50f1 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 14 Apr 2011 08:59:27 -0600 Subject: [PATCH 1/3] EPUB Input: Fix EPUB files with empty Adobe PAGE templates causing conversion to abort. Fixes #760390 (epub conversion issue) --- src/calibre/ebooks/oeb/transforms/page_margin.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/calibre/ebooks/oeb/transforms/page_margin.py b/src/calibre/ebooks/oeb/transforms/page_margin.py index bc1925e343..d7c99d24c6 100644 --- a/src/calibre/ebooks/oeb/transforms/page_margin.py +++ b/src/calibre/ebooks/oeb/transforms/page_margin.py @@ -20,8 +20,9 @@ class RemoveAdobeMargins(object): self.oeb, self.opts, self.log = oeb, opts, log for item in self.oeb.manifest: - if item.media_type in ('application/vnd.adobe-page-template+xml', - 'application/vnd.adobe.page-template+xml'): + if (item.media_type in ('application/vnd.adobe-page-template+xml', + 'application/vnd.adobe.page-template+xml') and + hasattr(item.data, 'xpath')): self.log('Removing page margins specified in the' ' Adobe page template') for elem in item.data.xpath( From 997975a8030b1193c244246204ef1729c8ed12c5 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 14 Apr 2011 09:03:57 -0600 Subject: [PATCH 2/3] Fix #760589 (CHMInput does not release file handle) --- src/calibre/ebooks/chm/input.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/calibre/ebooks/chm/input.py b/src/calibre/ebooks/chm/input.py index f55a76d67e..61160e8dac 100644 --- a/src/calibre/ebooks/chm/input.py +++ b/src/calibre/ebooks/chm/input.py @@ -51,6 +51,7 @@ class CHMInput(InputFormatPlugin): mainpath = os.path.join(tdir, mainname) metadata = get_metadata_from_reader(self._chm_reader) + self._chm_reader.CloseCHM() odi = options.debug_pipeline options.debug_pipeline = None From ac5d0dc001f64c0e7f948390ff5d8550f2de6ed2 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 14 Apr 2011 09:40:28 -0600 Subject: [PATCH 3/3] ... --- src/calibre/gui2/metadata/basic_widgets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/metadata/basic_widgets.py b/src/calibre/gui2/metadata/basic_widgets.py index b2ee79c9c0..73913ba58f 100644 --- a/src/calibre/gui2/metadata/basic_widgets.py +++ b/src/calibre/gui2/metadata/basic_widgets.py @@ -846,7 +846,7 @@ class RatingEdit(QSpinBox): # {{{ class TagsEdit(MultiCompleteLineEdit): # {{{ LABEL = _('Ta&gs:') TOOLTIP = '

'+_('Tags categorize the book. This is particularly ' - 'useful while searching.

They can be any words' + 'useful while searching.

They can be any words ' 'or phrases, separated by commas.') def __init__(self, parent):