Merge branch 'fix/syntax-python3-20170305' into travis
# Conflicts: # cps/epub.py # cps/web.py
This commit is contained in:
@@ -41,6 +41,11 @@ def get_epub_info(tmp_file_path, original_file_name, original_file_extension):
|
||||
p = tree.xpath('/pkg:package/pkg:metadata', namespaces=ns)[0]
|
||||
|
||||
epub_metadata = {}
|
||||
try:#maybe description isn't present
|
||||
comments = tree.xpath("//*[local-name() = 'description']/text()")[0]
|
||||
epub_metadata['comments'] = comments
|
||||
except IndexError as e:
|
||||
epub_metadata['comments'] = ""
|
||||
|
||||
for s in ['title', 'description', 'creator', 'language']:
|
||||
tmp = p.xpath('dc:%s/text()' % s, namespaces=ns)
|
||||
@@ -66,6 +71,8 @@ def get_epub_info(tmp_file_path, original_file_name, original_file_extension):
|
||||
epub_metadata['language'] = isoLanguages.get(part3=lang).name
|
||||
else:
|
||||
epub_metadata['language'] = ""
|
||||
except IndexError as e:
|
||||
epub_metadata['language'] = ""
|
||||
|
||||
coversection = tree.xpath("/pkg:package/pkg:manifest/pkg:item[@id='cover-image']/@href", namespaces=ns)
|
||||
coverfile = None
|
||||
|
||||
Reference in New Issue
Block a user