changeset 2188:052d560d0dce

jp (base): replaced log.warning by stderr prints
author Goffi <goffi@goffi.org>
date Sun, 12 Mar 2017 23:32:43 +0100
parents 4ec72927a222
children a25a256688e2
files frontends/src/jp/base.py
diffstat 1 files changed, 8 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/frontends/src/jp/base.py	Sun Mar 12 23:31:06 2017 +0100
+++ b/frontends/src/jp/base.py	Sun Mar 12 23:32:43 2017 +0100
@@ -112,8 +112,9 @@
 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 @@
                     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 @@
         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: