Skip to content

Commit

Permalink
Implement get_tool_relative_path for ToolConfRepository
Browse files Browse the repository at this point in the history
This is needed in case data_manager_manual should create a new data
table.
  • Loading branch information
mvdbeek committed Oct 17, 2019
1 parent 9dd5e76 commit 8a21cab
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions lib/galaxy/tools/toolbox/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,21 @@
"""

# A fake ToolShedRepository constructed from a shed tool conf
ToolConfRepository = namedtuple(
_ToolConfRepository = namedtuple(
'ToolConfRepository',
(
'tool_shed', 'name', 'owner', 'installed_changeset_revision', 'changeset_revision',
'tool_dependencies_installed_or_in_error', 'repository_path'
'tool_dependencies_installed_or_in_error', 'repository_path', 'tool_path',
)
)


class ToolConfRepository(_ToolConfRepository):

def get_tool_relative_path(self, *args, **kwargs):
return self.tool_path, self.repository_path


class AbstractToolBox(Dictifiable, ManagesIntegratedToolPanelMixin):
"""
Abstract container for managing a ToolPanel - containing tools and
Expand Down Expand Up @@ -677,8 +683,8 @@ def get_tool_repository_from_xml_item(self, elem, path):
"in database. Tool will be loaded without install database."
log.warning(msg, repository_name, repository_owner)
# Figure out path to repository on disk given the tool shed info and the path to the tool contained in the repo
repository_path = os.path.join('repos', repository_owner, repository_name, installed_changeset_revision)
repository_base_dir = path[:path.index(repository_path) + len(repository_path)]
repository_path = os.path.join(tool_shed, 'repos', repository_owner, repository_name, installed_changeset_revision)
tool_path = path[:path.index(repository_path)]
repository = ToolConfRepository(
tool_shed,
repository_name,
Expand All @@ -687,6 +693,7 @@ def get_tool_repository_from_xml_item(self, elem, path):
installed_changeset_revision,
None,
repository_path,
tool_path
)
self.app.tool_shed_repository_cache.add_local_repository(repository)
return repository
Expand Down

0 comments on commit 8a21cab

Please sign in to comment.