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:
parent
dc5c042fe7
commit
501bc92528
57 changed files with 707 additions and 941 deletions
|
|
@ -18,7 +18,8 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from sat.core.i18n import _, D_
|
||||
from logging import debug, info, error, warning
|
||||
from sat.core.log import getLogger
|
||||
log = getLogger(__name__)
|
||||
|
||||
from wokkel import disco, pubsub
|
||||
from twisted.internet import defer
|
||||
|
|
@ -94,7 +95,7 @@ class TextSyntaxes(object):
|
|||
}
|
||||
|
||||
def __init__(self, host):
|
||||
info(_("Text syntaxes plugin initialization"))
|
||||
log.info(_("Text syntaxes plugin initialization"))
|
||||
self.host = host
|
||||
self.syntaxes = {}
|
||||
self.addSyntax(self.SYNTAX_XHTML, lambda xhtml: defer.succeed(xhtml), lambda xhtml: defer.succeed(xhtml),
|
||||
|
|
@ -109,7 +110,7 @@ class TextSyntaxes(object):
|
|||
return h.handle(html)
|
||||
self.addSyntax(self.SYNTAX_MARKDOWN, markdown.markdown, _html2text, [TextSyntaxes.OPT_DEFAULT])
|
||||
except ImportError:
|
||||
warning("markdown or html2text not found, can't use Markdown syntax")
|
||||
log.warning("markdown or html2text not found, can't use Markdown syntax")
|
||||
host.bridge.addMethod("syntaxConvert", ".plugin", in_sign='sssbs', out_sign='s',
|
||||
async=True, method=self.convert)
|
||||
|
||||
|
|
@ -173,7 +174,7 @@ class TextSyntaxes(object):
|
|||
elif isinstance(xhtml, html.HtmlElement):
|
||||
xhtml_elt = xhtml
|
||||
else:
|
||||
error("Only strings and HtmlElements can be cleaned")
|
||||
log.error("Only strings and HtmlElements can be cleaned")
|
||||
raise exceptions.DataError
|
||||
cleaner = clean.Cleaner(style=False,
|
||||
add_nofollow=False,
|
||||
|
|
|
|||
Loading…
Reference in a new issue