From f5b404108d3271f1fecc9c420160b84d45446dca Mon Sep 17 00:00:00 2001 From: Paul Franklin Date: Sun, 8 Jun 2014 13:03:39 -0700 Subject: [PATCH] improve plugin warning --- gramps/gen/plug/_manager.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gramps/gen/plug/_manager.py b/gramps/gen/plug/_manager.py index c4236d3ef..4a8688fbd 100644 --- a/gramps/gen/plug/_manager.py +++ b/gramps/gen/plug/_manager.py @@ -271,9 +271,11 @@ class BasePluginManager(object): os.chdir(oldwd) sys.path.pop(0) except ValueError as err: - LOG.warning('Plugin error: %s', err) + LOG.warning("Plugin error (from '%s'): %s" + % (pdata.mod_name, err)) else: - LOG.warning('Plugin error: %s', err) + LOG.warning("Plugin error (from '%s'): %s" + % (pdata.mod_name, err)) except ImportError as err: # Python2 on Windows not work with unicode in sys.path # but module can be loaded from current directory @@ -284,9 +286,11 @@ class BasePluginManager(object): module = __import__(pdata.mod_name) os.chdir(oldwd) except ImportError as err: - LOG.warning('Plugin error: %s', err) + LOG.warning("Plugin error (from '%s'): %s" + % (pdata.mod_name, err)) else: - LOG.warning('Plugin error: %s', err) + LOG.warning("Plugin error (from '%s'): %s" + % (pdata.mod_name, err)) sys.path.pop(0) else: print("WARNING: module cannot be loaded")