From 056ff14eb0250cb0da4eae4b980e11525589cf65 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Sun, 22 Jan 2012 17:49:35 +0100 Subject: encoding fixes --- module/plugins/Base.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'module/plugins/Base.py') diff --git a/module/plugins/Base.py b/module/plugins/Base.py index 48a3707b1..34074095e 100644 --- a/module/plugins/Base.py +++ b/module/plugins/Base.py @@ -18,6 +18,7 @@ """ import sys +from module.utils import decode from module.utils.fs import exists, makedirs, join # TODO @@ -101,7 +102,17 @@ class Base(object): else: sep = " | " - getattr(self.log, level)("%s: %s" % (self.__name__, sep.join([a if isinstance(a, basestring) else str(a) for a in args]))) + + strings = [] + for obj in args: + if type(obj) == unicode: + strings.append(obj) + elif type(obj) == str: + strings.append(decode(obj)) + else: + strings.append(str(obj)) + + getattr(self.log, level)("%s: %s" % (self.__name__, sep.join(strings))) def setConfig(self, option, value): """ Set config value for current plugin -- cgit v1.2.3