mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-01-18 10:35:09 +01:00
CHM Input: Handle CHM files that dont specify a topics file. Fixes #9253 (Failed to convert .chm file)
This commit is contained in:
parent
5ade2ccc74
commit
448c405ef2
1 changed files with 6 additions and 2 deletions
|
|
@ -54,8 +54,12 @@ def __init__(self, input, log):
|
|||
self._extracted = False
|
||||
|
||||
# location of '.hhc' file, which is the CHM TOC.
|
||||
self.root, ext = os.path.splitext(self.topics.lstrip('/'))
|
||||
self.hhc_path = self.root + ".hhc"
|
||||
if self.topics is None:
|
||||
self.root, ext = os.path.splitext(self.home.lstrip('/'))
|
||||
self.hhc_path = self.root + ".hhc"
|
||||
else:
|
||||
self.root, ext = os.path.splitext(self.topics.lstrip('/'))
|
||||
self.hhc_path = self.root + ".hhc"
|
||||
|
||||
def _parse_toc(self, ul, basedir=os.getcwdu()):
|
||||
toc = TOC(play_order=self._playorder, base_path=basedir, text='')
|
||||
|
|
|
|||
Loading…
Reference in a new issue