import conf.prefs when needed

This commit is contained in:
Hiroshi Miura 2011-01-28 20:59:01 +09:00
parent 868d43af68
commit 5e0869d9c9

View File

@ -8,7 +8,6 @@ __docformat__ = 'restructuredtext en'
import functools, re import functools, re
from calibre import entity_to_unicode from calibre import entity_to_unicode
from calibre.utils.config import prefs
XMLDECL_RE = re.compile(r'^\s*<[?]xml.*?[?]>') XMLDECL_RE = re.compile(r'^\s*<[?]xml.*?[?]>')
SVG_NS = 'http://www.w3.org/2000/svg' SVG_NS = 'http://www.w3.org/2000/svg'
@ -525,6 +524,7 @@ class HTMLPreProcessor(object):
if getattr(self.extra_opts, 'asciiize', False): if getattr(self.extra_opts, 'asciiize', False):
from calibre.ebooks.unihandecode import Unihandecoder from calibre.ebooks.unihandecode import Unihandecoder
from calibre.utils.config import prefs
unihandecoder = Unihandecoder(lang=prefs['language']) unihandecoder = Unihandecoder(lang=prefs['language'])
html = unihandecoder.decode(html) html = unihandecoder.decode(html)