core: use of the new core.log module:

/!\ this is a massive refactoring and was largely automated, it probably did bring some bugs /!\
This commit is contained in:
Goffi 2014-04-19 19:19:19 +02:00
commit 501bc92528

View file

@ -19,9 +19,10 @@
from sat.core.i18n import _
from sat.core import exceptions
from logging import debug, info, error
from sat.core.log import getLogger
log = getLogger(__name__)
from wokkel import disco, pubsub, iwokkel
from wokkel import disco, iwokkel
from zope.interface import implements
# from lxml import etree
from lxml import html
@ -69,7 +70,7 @@ class XEP_0071(object):
SYNTAX_XHTML_IM = "XHTML-IM"
def __init__(self, host):
info(_("XHTML-IM plugin initialization"))
log.info(_("XHTML-IM plugin initialization"))
self.host = host
self.synt_plg = self.host.plugins["TEXT-SYNTAXES"]
self.synt_plg.addSyntax(self.SYNTAX_XHTML_IM, lambda xhtml: xhtml, self.XHTML2XHTML_IM, [self.synt_plg.OPT_HIDDEN])
@ -189,7 +190,7 @@ class XEP_0071(object):
for elem in to_strip:
if elem.tag in blacklist:
#we need to remove the element and all descendants
debug(u"removing black listed tag: %s" % (elem.tag))
log.debug(u"removing black listed tag: %s" % (elem.tag))
elem.drop_tree()
else:
elem.drop_tag()