From b80fc40aee8adb0819bd21ee6683de20731b1a9a Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 10 Jul 2009 00:37:06 +0900 Subject: [PATCH] lazy-load beautifulsoup --- anki/importing/supermemo_xml.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/anki/importing/supermemo_xml.py b/anki/importing/supermemo_xml.py index af78e44b7..b84fcc014 100644 --- a/anki/importing/supermemo_xml.py +++ b/anki/importing/supermemo_xml.py @@ -18,7 +18,6 @@ from xml.dom import minidom, Node from types import DictType, InstanceType from string import capwords, maketrans import re, unicodedata, time -from BeautifulSoup import BeautifulStoneSoup #import chardet @@ -133,7 +132,7 @@ class SupermemoXmlImporter(Importer): def _decode_htmlescapes(self,s): """Unescape HTML code.""" - + from BeautifulSoup import BeautifulStoneSoup #my sm2004 also ecaped & chars in escaped sequences. s = re.sub(u'&',u'&',s) return unicode(BeautifulStoneSoup(s,convertEntities=BeautifulStoneSoup.HTML_ENTITIES ))