mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 06:33:08 +02:00
...
This commit is contained in:
parent
2f437907a3
commit
83feb86713
1 changed files with 3 additions and 1 deletions
|
|
@ -8,7 +8,6 @@
|
|||
from lxml import html
|
||||
|
||||
from calibre.customize.conversion import InputFormatPlugin
|
||||
from calibre.ebooks.chm.reader import CHMReader, match_string
|
||||
from calibre.ptempfile import TemporaryDirectory
|
||||
from calibre.utils.localization import get_lang
|
||||
from calibre.utils.filenames import ascii_filename
|
||||
|
|
@ -21,6 +20,7 @@ class CHMInput(InputFormatPlugin):
|
|||
file_types = set(['chm'])
|
||||
|
||||
def _chmtohtml(self, output_dir, chm_path, no_images, log):
|
||||
from calibre.ebooks.chm.reader import CHMReader
|
||||
log.debug('Opening CHM file')
|
||||
rdr = CHMReader(chm_path, log)
|
||||
log.debug('Extracting CHM to %s' % output_dir)
|
||||
|
|
@ -168,6 +168,8 @@ def _visit_node(self, node, chapters, depth):
|
|||
# check that node is a normal node (not a comment, DOCTYPE, etc.)
|
||||
# (normal nodes have string tags)
|
||||
if isinstance(node.tag, basestring):
|
||||
from calibre.ebooks.chm.reader import match_string
|
||||
|
||||
if match_string(node.tag, 'object') and match_string(node.attrib['type'], 'text/sitemap'):
|
||||
for child in node:
|
||||
if match_string(child.tag,'param') and match_string(child.attrib['name'], 'name'):
|
||||
|
|
|
|||
Loading…
Reference in a new issue