jp (base): replaced log.warning by stderr prints
This commit is contained in:
parent
a860999204
commit
09bf7b9b11
1 changed files with 8 additions and 7 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue