jp (base): replaced log.warning by stderr prints

This commit is contained in:
Goffi 2017-03-12 23:32:43 +01:00
commit 09bf7b9b11

View file

@ -112,8 +112,9 @@ if sys.version_info < (2, 7, 3):
try:
import progressbar
except ImportError:
log.warning(_(u'ProgressBar not available, please download it at http://pypi.python.org/pypi/progressbar'))
log.warning(_(u'Progress bar deactivated\n--\n'))
msg = (_(u'ProgressBar not available, please download it at http://pypi.python.org/pypi/progressbar\n') +
_(u'Progress bar deactivated\n--\n'))
print >>sys.stderr,msg.encode('utf-8')
progressbar=None
#consts
@ -351,15 +352,15 @@ class Jp(object):
module = import_module(module_path)
self.import_plugin_module(module, type_)
except ImportError as e:
log.warning(_(u"Can't import {module_path} plugin, ignoring it: {msg}".format(
self.disp(_(u"Can't import {module_path} plugin, ignoring it: {msg}".format(
module_path = module_path,
msg = e)))
msg = e)), error=True)
except exceptions.CancelError:
continue
except exceptions.MissingModule as e:
log.warning(_(u"Missing module for plugin {name}: {missing}".format(
self.disp(_(u"Missing module for plugin {name}: {missing}".format(
name = module_path,
missing = e)))
missing = e)), error=True)
def import_plugin_module(self, module, type_):
@ -371,7 +372,7 @@ class Jp(object):
try:
class_names = getattr(module, '__{}__'.format(type_))
except AttributeError:
log.warning(_("Invalid plugin module [{type}] {module}").format(type=type_, module=module))
log.disp(_(u"Invalid plugin module [{type}] {module}").format(type=type_, module=module), error=True)
raise ImportError
else:
for class_name in class_names: