mirror of
https://github.com/ankitects/anki.git
synced 2025-09-22 16:02:23 -04:00
lazy-load beautifulsoup
This commit is contained in:
parent
2f2487e5b8
commit
b80fc40aee
1 changed files with 1 additions and 2 deletions
|
@ -18,7 +18,6 @@ from xml.dom import minidom, Node
|
||||||
from types import DictType, InstanceType
|
from types import DictType, InstanceType
|
||||||
from string import capwords, maketrans
|
from string import capwords, maketrans
|
||||||
import re, unicodedata, time
|
import re, unicodedata, time
|
||||||
from BeautifulSoup import BeautifulStoneSoup
|
|
||||||
#import chardet
|
#import chardet
|
||||||
|
|
||||||
|
|
||||||
|
@ -133,7 +132,7 @@ class SupermemoXmlImporter(Importer):
|
||||||
|
|
||||||
def _decode_htmlescapes(self,s):
|
def _decode_htmlescapes(self,s):
|
||||||
"""Unescape HTML code."""
|
"""Unescape HTML code."""
|
||||||
|
from BeautifulSoup import BeautifulStoneSoup
|
||||||
#my sm2004 also ecaped & chars in escaped sequences.
|
#my sm2004 also ecaped & chars in escaped sequences.
|
||||||
s = re.sub(u'&',u'&',s)
|
s = re.sub(u'&',u'&',s)
|
||||||
return unicode(BeautifulStoneSoup(s,convertEntities=BeautifulStoneSoup.HTML_ENTITIES ))
|
return unicode(BeautifulStoneSoup(s,convertEntities=BeautifulStoneSoup.HTML_ENTITIES ))
|
||||||
|
|
Loading…
Reference in a new issue