mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 23:13:27 +02:00
Fix #587
This commit is contained in:
parent
34ddfb4135
commit
3ae6a3fb0c
1 changed files with 6 additions and 3 deletions
|
|
@ -79,7 +79,7 @@ def read_from_opf(self, opfreader):
|
|||
if 'toc' in item.href.lower():
|
||||
toc = item.href
|
||||
break
|
||||
|
||||
|
||||
if toc is not None:
|
||||
if toc.lower() != 'ncx':
|
||||
toc = urlparse(unquote(toc))[2]
|
||||
|
|
@ -92,9 +92,12 @@ def read_from_opf(self, opfreader):
|
|||
bn = bn.replace('_top.htm', '_toc.htm') # Bug in BAEN OPF files
|
||||
toc = os.path.join(os.path.dirname(toc), bn)
|
||||
|
||||
self.read_html_toc(toc, self.base_path)
|
||||
self.read_html_toc(toc)
|
||||
except:
|
||||
pass
|
||||
print 'WARNING: Could not read Table of Contents:'
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
print 'Continuing anyway'
|
||||
else:
|
||||
cwd = os.path.abspath(self.base_path)
|
||||
m = glob.glob(os.path.join(cwd, '*.ncx'))
|
||||
|
|
|
|||
Loading…
Reference in a new issue