GwR patch for missing OPF

This commit is contained in:
GRiker 2011-04-30 04:08:51 -06:00
parent 79249a8429
commit 1c5efc3d1c

View File

@ -163,6 +163,8 @@ class ITUNES(DriverBase):
settings()
set_progress_reporter()
upload_books()
_get_fpath()
_update_epub_metadata()
add_books_to_metadata()
use_plugboard_ext()
set_plugboard()
@ -2621,13 +2623,13 @@ class ITUNES(DriverBase):
# Touch the OPF timestamp
try:
zf_opf = ZipFile(fpath,'r')
fnames = zf_opf.namelist()
opf = [x for x in fnames if '.opf' in x][0]
except:
raise UserFeedback("'%s' is not a valid EPUB" % metadata.title,
None,
level=UserFeedback.WARN)
fnames = zf_opf.namelist()
opf = [x for x in fnames if '.opf' in x][0]
if opf:
opf_tree = etree.fromstring(zf_opf.read(opf))
md_els = opf_tree.xpath('.//*[local-name()="metadata"]')
if md_els: