From 4987b9b9b44dd747970d5e6ac664de209202337d Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Fri, 1 Dec 2006 15:48:25 +0000 Subject: [PATCH] * src/ArgHandler.py (cl_action): Properly call CLI tool. * src/plugins/DumpGenderStats.py (__init__): Fix CLI mode. * src/PluginUtils/_Tool.py (cli_tool): Fix CLI tools. svn: r7741 --- ChangeLog | 3 +++ src/ArgHandler.py | 2 +- src/PluginUtils/_Tool.py | 6 +++--- src/plugins/DumpGenderStats.py | 4 +++- src/plugins/RebuildRefMap.py | 4 ++-- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 87c56f688..b74b881b4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,7 @@ 2006-12-01 Alex Roitman + * src/ArgHandler.py (cl_action): Properly call CLI tool. + * src/plugins/DumpGenderStats.py (__init__): Fix CLI mode. + * src/PluginUtils/_Tool.py (cli_tool): Fix CLI tools. * src/plugins/Makefile.am (pkgdata_PYTHON): Ship new file. * src/plugins/RebuildRefMap.py: Add new plugin. * src/GrampsDb/_GrampsBSDDB.py (reindex_reference_map): Fix reindexing. diff --git a/src/ArgHandler.py b/src/ArgHandler.py index 92a61b974..cd739de3e 100644 --- a/src/ArgHandler.py +++ b/src/ArgHandler.py @@ -674,7 +674,7 @@ class ArgHandler: category = item[1] tool_class = item[2] options_class = item[3] - Tool.cli_tool(self.state.db,name,category, + Tool.cli_tool(self.state,name,category, tool_class,options_class,options_str_dict) return diff --git a/src/PluginUtils/_Tool.py b/src/PluginUtils/_Tool.py index a0c4c1f42..f017459da 100644 --- a/src/PluginUtils/_Tool.py +++ b/src/PluginUtils/_Tool.py @@ -271,9 +271,9 @@ def gui_tool(dbstate, uistate, tool_class, options_class, translated_name, log.error("Failed to start tool.", exc_info=True) # Command-line generic task -def cli_tool( database,name,category,tool_class,options_class,options_str_dict): +def cli_tool(dbstate,name,category,tool_class,options_class,options_str_dict): - clt = CommandLineTool(database,name,category, + clt = CommandLineTool(dbstate.db,name,category, options_class,options_str_dict) # Exit here if show option was given @@ -282,7 +282,7 @@ def cli_tool( database,name,category,tool_class,options_class,options_str_dict): # run tool try: - tool_class(database,clt.person,clt.option_class,name) + tool_class(dbstate,None,options_class,name,None) except: log.error("Failed to start tool.", exc_info=True) diff --git a/src/plugins/DumpGenderStats.py b/src/plugins/DumpGenderStats.py index 2afd92f64..fbf419704 100644 --- a/src/plugins/DumpGenderStats.py +++ b/src/plugins/DumpGenderStats.py @@ -39,7 +39,9 @@ class DumpGenderStats(Tool.Tool, ManagedWindow.ManagedWindow): def __init__(self, dbstate, uistate, options_class, name, callback=None): self.label = _("Gender Statistics tool") Tool.Tool.__init__(self, dbstate, options_class, name) - ManagedWindow.ManagedWindow.__init__(self,uistate,[],self.__class__) + if uistate: + ManagedWindow.ManagedWindow.__init__(self,uistate,[], + self.__class__) stats_list = [] diff --git a/src/plugins/RebuildRefMap.py b/src/plugins/RebuildRefMap.py index 35635d6cc..7f9f15ef9 100644 --- a/src/plugins/RebuildRefMap.py +++ b/src/plugins/RebuildRefMap.py @@ -109,9 +109,9 @@ register_tool( tool_class = RebuildRefMap, options_class = RebuildRefMapOptions, modes = Tool.MODE_GUI | Tool.MODE_CLI, - translated_name = _("Rebuild reference map"), + translated_name = _("Rebuild reference maps"), status=(_("Stable")), author_name = "Alex Roitman", author_email = "shura@gramps-project.org", - description=_("Rebuilds reference map") + description=_("Rebuilds reference maps") )