* 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
This commit is contained in:
Alex Roitman 2006-12-01 15:48:25 +00:00
parent e01c00b369
commit 61c3c2d3de
5 changed files with 12 additions and 7 deletions

View File

@ -1,4 +1,7 @@
2006-12-01 Alex Roitman <shura@gramps-project.org> 2006-12-01 Alex Roitman <shura@gramps-project.org>
* 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/Makefile.am (pkgdata_PYTHON): Ship new file.
* src/plugins/RebuildRefMap.py: Add new plugin. * src/plugins/RebuildRefMap.py: Add new plugin.
* src/GrampsDb/_GrampsBSDDB.py (reindex_reference_map): Fix reindexing. * src/GrampsDb/_GrampsBSDDB.py (reindex_reference_map): Fix reindexing.

View File

@ -674,7 +674,7 @@ class ArgHandler:
category = item[1] category = item[1]
tool_class = item[2] tool_class = item[2]
options_class = item[3] 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) tool_class,options_class,options_str_dict)
return return

View File

@ -271,9 +271,9 @@ def gui_tool(dbstate, uistate, tool_class, options_class, translated_name,
log.error("Failed to start tool.", exc_info=True) log.error("Failed to start tool.", exc_info=True)
# Command-line generic task # 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) options_class,options_str_dict)
# Exit here if show option was given # 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 # run tool
try: try:
tool_class(database,clt.person,clt.option_class,name) tool_class(dbstate,None,options_class,name,None)
except: except:
log.error("Failed to start tool.", exc_info=True) log.error("Failed to start tool.", exc_info=True)

View File

@ -39,7 +39,9 @@ class DumpGenderStats(Tool.Tool, ManagedWindow.ManagedWindow):
def __init__(self, dbstate, uistate, options_class, name, callback=None): def __init__(self, dbstate, uistate, options_class, name, callback=None):
self.label = _("Gender Statistics tool") self.label = _("Gender Statistics tool")
Tool.Tool.__init__(self, dbstate, options_class, name) 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 = [] stats_list = []

View File

@ -109,9 +109,9 @@ register_tool(
tool_class = RebuildRefMap, tool_class = RebuildRefMap,
options_class = RebuildRefMapOptions, options_class = RebuildRefMapOptions,
modes = Tool.MODE_GUI | Tool.MODE_CLI, modes = Tool.MODE_GUI | Tool.MODE_CLI,
translated_name = _("Rebuild reference map"), translated_name = _("Rebuild reference maps"),
status=(_("Stable")), status=(_("Stable")),
author_name = "Alex Roitman", author_name = "Alex Roitman",
author_email = "shura@gramps-project.org", author_email = "shura@gramps-project.org",
description=_("Rebuilds reference map") description=_("Rebuilds reference maps")
) )