delay beautifulsoup import until export

This commit is contained in:
Damien Elmes 2010-04-01 22:57:26 +09:00
parent 7f75364fbe
commit af66630f07

View file

@ -17,7 +17,6 @@ from anki.lang import _
from anki.utils import findTag, parseTags, stripHTML, ids2str from anki.utils import findTag, parseTags, stripHTML, ids2str
from anki.tags import tagIds from anki.tags import tagIds
from anki.db import * from anki.db import *
from BeautifulSoup import BeautifulSoup as BS
class Exporter(object): class Exporter(object):
def __init__(self, deck): def __init__(self, deck):
@ -33,6 +32,7 @@ class Exporter(object):
def escapeText(self, text, removeFields=False): def escapeText(self, text, removeFields=False):
"Escape newlines and tabs, and strip Anki HTML." "Escape newlines and tabs, and strip Anki HTML."
from BeautifulSoup import BeautifulSoup as BS
text = text.replace("\n", "<br>") text = text.replace("\n", "<br>")
text = text.replace("\t", " " * 8) text = text.replace("\t", " " * 8)
if removeFields: if removeFields: