From 29f0513b49992dc7a662a23c5c538516848a5786 Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Wed, 30 Mar 2011 17:38:40 +0000 Subject: [PATCH] Fixed error report in mailing list by Peter 2011-03-30 svn: r16990 --- src/gui/widgets/grampletpane.py | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/gui/widgets/grampletpane.py b/src/gui/widgets/grampletpane.py index e980a2312..f51fdb305 100644 --- a/src/gui/widgets/grampletpane.py +++ b/src/gui/widgets/grampletpane.py @@ -151,17 +151,20 @@ def make_requested_gramplet(gui_class, pane, opts, dbstate, uistate): """ Make a GUI gramplet given its name. """ - name = opts["name"] - if name in AVAILABLE_GRAMPLETS(): - gui = gui_class(pane, dbstate, uistate, **opts) - if opts.get("content", None): - pdata = PLUGMAN.get_plugin(name) - module = PLUGMAN.load_plugin(pdata) - if module: - getattr(module, opts["content"])(gui) - else: - print "Error loading gramplet '%s': skipping content" % name - return gui + if "name" in opts: + name = opts["name"] + if name in AVAILABLE_GRAMPLETS(): + gui = gui_class(pane, dbstate, uistate, **opts) + if opts.get("content", None): + pdata = PLUGMAN.get_plugin(name) + module = PLUGMAN.load_plugin(pdata) + if module: + getattr(module, opts["content"])(gui) + else: + print "Error loading gramplet '%s': skipping content" % name + return gui + else: + print "Error loading gramplet '%s': unknown name" % name return None def logical_true(value):