mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04: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
@ -54,8 +54,12 @@ class CHMReader(CHMFile):
|
|||||||
self._extracted = False
|
self._extracted = False
|
||||||
|
|
||||||
# location of '.hhc' file, which is the CHM TOC.
|
# location of '.hhc' file, which is the CHM TOC.
|
||||||
self.root, ext = os.path.splitext(self.topics.lstrip('/'))
|
if self.topics is None:
|
||||||
self.hhc_path = self.root + ".hhc"
|
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()):
|
def _parse_toc(self, ul, basedir=os.getcwdu()):
|
||||||
toc = TOC(play_order=self._playorder, base_path=basedir, text='')
|
toc = TOC(play_order=self._playorder, base_path=basedir, text='')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user