* 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 685c655b80
commit 4987b9b9b4
5 changed files with 12 additions and 7 deletions

View File

@ -1,4 +1,7 @@
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/RebuildRefMap.py: Add new plugin.
* src/GrampsDb/_GrampsBSDDB.py (reindex_reference_map): Fix reindexing.

View File

@ -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

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)
# 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)

View File

@ -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 = []

View File

@ -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")
)