From 83feb86713d17775f02fa52b069d7afabfb9369d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 27 Feb 2010 23:21:41 -0700 Subject: [PATCH] ... --- src/calibre/ebooks/chm/input.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/chm/input.py b/src/calibre/ebooks/chm/input.py index 29bf9adc75..e2a270f2b8 100644 --- a/src/calibre/ebooks/chm/input.py +++ b/src/calibre/ebooks/chm/input.py @@ -8,7 +8,6 @@ import os, uuid 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 @@ class CHMInput(InputFormatPlugin): # 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'):