Refactor to clean up args in one method of galaxy.tools.

This commit is contained in:
John Chilton
2017-08-08 08:26:12 -04:00
parent d2394aa172
commit 210d3e31ab
+5 -2
View File
@@ -228,7 +228,7 @@ class ToolBox( BaseGalaxyToolBox ):
# Deprecated method, TODO - eliminate calls to this in test/.
return self._tools_by_id
def create_tool( self, config_file, repository_id=None, guid=None, **kwds ):
def create_tool( self, config_file, **kwds ):
try:
tool_source = get_tool_source(
config_file,
@@ -239,6 +239,9 @@ class ToolBox( BaseGalaxyToolBox ):
# capture and log parsing errors
global_tool_errors.add_error(config_file, "Tool XML parsing", e)
raise e
return self._create_tool_from_source( tool_source, config_file=config_file, **kwds )
def _create_tool_from_source( self, tool_source, config_file=None, **kwds ):
# Allow specifying a different tool subclass to instantiate
tool_module = tool_source.parse_tool_module()
if tool_module is not None:
@@ -252,7 +255,7 @@ class ToolBox( BaseGalaxyToolBox ):
# Normal tool
root = getattr( tool_source, 'root', None )
ToolClass = Tool
tool = ToolClass( config_file, tool_source, self.app, guid=guid, repository_id=repository_id, **kwds )
tool = ToolClass( config_file, tool_source, self.app, **kwds )
return tool
def get_tool_components( self, tool_id, tool_version=None, get_loaded_tools_by_lineage=False, set_selected=False ):