* src/Witness.py (WitnessEditor.__init__): Typo.
* src/PluginMgr.py: Update all lists properly on any registration; (purge_failed): Add function. * src/Plugins.py (Reload.__init__): Purge plugins newly failed on reload; Regenerate all menus after reload. * src/gramps_main.py (build_plugin_menus): Add optional argument indicating rebuild, do not load plugins on rebuild; (load_plugins) factor out plugin loading routine. svn: r5361
This commit is contained in:
@@ -611,8 +611,31 @@ class Reload(Tool.Tool):
|
||||
except:
|
||||
PluginMgr.failmsg_list.append((filename,sys.exc_info()))
|
||||
|
||||
# Remove previously good plugins that are now bad
|
||||
# from the registered lists
|
||||
(PluginMgr.export_list,
|
||||
PluginMgr.import_list,
|
||||
PluginMgr.tool_list,
|
||||
PluginMgr.cli_tool_list,
|
||||
PluginMgr.report_list,
|
||||
PluginMgr.bkitems_list,
|
||||
PluginMgr.cl_list,
|
||||
PluginMgr.textdoc_list,
|
||||
PluginMgr.bookdoc_list,
|
||||
PluginMgr.drawdoc_list) = PluginMgr.purge_failed(
|
||||
PluginMgr.failmsg_list,
|
||||
PluginMgr.export_list,
|
||||
PluginMgr.import_list,
|
||||
PluginMgr.tool_list,
|
||||
PluginMgr.cli_tool_list,
|
||||
PluginMgr.report_list,
|
||||
PluginMgr.bkitems_list,
|
||||
PluginMgr.cl_list,
|
||||
PluginMgr.textdoc_list,
|
||||
PluginMgr.bookdoc_list,
|
||||
PluginMgr.drawdoc_list)
|
||||
|
||||
# attempt to load the plugins that have failed in the past
|
||||
|
||||
for (filename,message) in oldfailmsg:
|
||||
name = os.path.split(filename)
|
||||
match = pymod.match(name[1])
|
||||
@@ -656,6 +679,9 @@ class Reload(Tool.Tool):
|
||||
status_up.close(None)
|
||||
status_up = None
|
||||
|
||||
# Re-generate tool and report menus
|
||||
parent.build_plugin_menus(rebuild=True)
|
||||
|
||||
class ReloadOptions(Tool.ToolOptions):
|
||||
"""
|
||||
Defines options and provides handling interface.
|
||||
|
||||
Reference in New Issue
Block a user