EPUB Input: Fix EPUB files with empty Adobe PAGE templates causing conversion to abort. Fixes #760390 (epub conversion issue)

This commit is contained in:
Kovid Goyal 2011-04-14 08:59:27 -06:00
parent 869222f9c3
commit a9a9d8f4ba

View File

@ -20,8 +20,9 @@ class RemoveAdobeMargins(object):
self.oeb, self.opts, self.log = oeb, opts, log self.oeb, self.opts, self.log = oeb, opts, log
for item in self.oeb.manifest: for item in self.oeb.manifest:
if item.media_type in ('application/vnd.adobe-page-template+xml', if (item.media_type in ('application/vnd.adobe-page-template+xml',
'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' self.log('Removing page margins specified in the'
' Adobe page template') ' Adobe page template')
for elem in item.data.xpath( for elem in item.data.xpath(