1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/0a3e4bc2b5a5/ changeset: 0a3e4bc2b5a5 user: greg date: 2012-12-21 02:48:11 summary: Fixes for administering tool dependencies associated with tool shed repositories installe dinto a Galaxy instance. affected #: 5 files diff -r c159eafdf9d3e97e12b7c9db53509f13842c5b96 -r 0a3e4bc2b5a510820b8aba73b78433db810a3481 lib/galaxy/util/shed_util.py --- a/lib/galaxy/util/shed_util.py +++ b/lib/galaxy/util/shed_util.py @@ -499,6 +499,8 @@ type = td_info_dict[ 'type' ] tool_dependency = get_tool_dependency_by_name_type_repository( trans, repository, name, type ) if tool_dependency: + td_info_dict[ 'repository_id' ] = repository.id + td_info_dict[ 'tool_dependency_id' ] = tool_dependency.id td_info_dict[ 'status' ] = str( tool_dependency.status ) val[ index ] = td_info_dict if tool_dependency.status == trans.model.ToolDependency.installation_status.INSTALLED: @@ -510,12 +512,14 @@ version = val[ 'version' ] type = val[ 'type' ] tool_dependency = get_tool_dependency_by_name_version_type_repository( trans, repository, name, version, type ) - val[ 'status' ] = str( tool_dependency.status ) - if tool_dependency: - if tool_dependency.status == trans.model.ToolDependency.installation_status.INSTALLED: - tool_dependencies[ td_key ] = val - else: - missing_tool_dependencies[ td_key ] = val + if tool_dependency: + val[ 'repository_id' ] = repository.id + val[ 'tool_dependency_id' ] = tool_dependency.id + val[ 'status' ] = str( tool_dependency.status ) + if tool_dependency.status == trans.model.ToolDependency.installation_status.INSTALLED: + tool_dependencies[ td_key ] = val + else: + missing_tool_dependencies[ td_key ] = val else: tool_dependencies = None missing_tool_dependencies = None diff -r c159eafdf9d3e97e12b7c9db53509f13842c5b96 -r 0a3e4bc2b5a510820b8aba73b78433db810a3481 lib/galaxy/util/shed_util_common.py --- a/lib/galaxy/util/shed_util_common.py +++ b/lib/galaxy/util/shed_util_common.py @@ -135,8 +135,8 @@ description = 'click the name to browse the dependency installation directory' folder_id, tool_dependencies_root_folder = container_util.build_tool_dependencies_folder( folder_id, tool_dependencies, + label='Installed tool dependencies', for_galaxy=True, - repository_id=repository_id , description=description, display_status=False ) containers_dict[ 'tool_dependencies' ] = tool_dependencies_root_folder @@ -148,7 +148,6 @@ missing_tool_dependencies, label='Missing tool dependencies', for_galaxy=True, - repository_id=repository_id, description=description, display_status=True ) containers_dict[ 'missing_tool_dependencies' ] = missing_tool_dependencies_root_folder @@ -220,7 +219,6 @@ folder_id, tool_dependencies_root_folder = container_util.build_tool_dependencies_folder( folder_id, tool_dependencies, for_galaxy=False, - repository_id=None, description=None, display_status=False ) containers_dict[ 'tool_dependencies' ] = tool_dependencies_root_folder @@ -837,7 +835,7 @@ env_name = env_elem.get( 'name', None ) if env_name: requirements_dict [ 'name' ] = env_name - requirements_dict [ 'type' ] = 'environment variable' + requirements_dict [ 'type' ] = 'set_environment' if requirements_dict: if 'set_environment' in tool_dependencies_dict: tool_dependencies_dict[ 'set_environment' ].append( requirements_dict ) diff -r c159eafdf9d3e97e12b7c9db53509f13842c5b96 -r 0a3e4bc2b5a510820b8aba73b78433db810a3481 lib/galaxy/webapps/community/util/container_util.py --- a/lib/galaxy/webapps/community/util/container_util.py +++ b/lib/galaxy/webapps/community/util/container_util.py @@ -98,7 +98,8 @@ class ToolDependency( object ): """Tool dependency object""" - def __init__( self, id=None, name=None, version=None, type=None, install_dir=None, readme=None, installation_status=None, repository_id=None, ): + def __init__( self, id=None, name=None, version=None, type=None, install_dir=None, readme=None, installation_status=None, repository_id=None, + tool_dependency_id=None ): self.id = id self.name = name self.version = version @@ -107,6 +108,7 @@ self.readme = readme self.installation_status = installation_status self.repository_id = repository_id + self.tool_dependency_id = tool_dependency_id class Workflow( object ): """Workflow object""" @@ -279,8 +281,7 @@ else: tools_root_folder = None return folder_id, tools_root_folder -def build_tool_dependencies_folder( folder_id, tool_dependencies, label='Installed tool dependencies', for_galaxy=False, repository_id=None, description=None, - display_status=False ): +def build_tool_dependencies_folder( folder_id, tool_dependencies, label='Tool dependencies', for_galaxy=False, description=None, display_status=False ): """Return a folder hierarchy containing tool dependencies.""" if tool_dependencies: tool_dependency_id = 0 @@ -298,8 +299,7 @@ tool_dependency = ToolDependency( id=tool_dependency_id, name='Name', version='Version', - type='Type', - repository_id=repository_id ) + type='Type' ) if display_status: tool_dependency.installation_status = 'Status' else: @@ -308,8 +308,7 @@ tool_dependency = ToolDependency( id=tool_dependency_id, name='Name', version='Version', - type='Type', - repository_id=repository_id ) + type='Type' ) if display_status: tool_dependency.installation_status = 'Status' folder.tool_dependencies.append( tool_dependency ) @@ -317,25 +316,30 @@ tool_dependency_id += 1 if dependency_key == 'set_environment': for set_environment_dict in requirements_dict: - name = set_environment_dict[ 'name' ] + name = set_environment_dict.get( 'name', None ) type = set_environment_dict[ 'type' ] + repository_id = set_environment_dict.get( 'repository_id', None ) + td_id = set_environment_dict.get( 'tool_dependency_id', None ) if display_status: - installation_status = set_environment_dict[ 'status' ] + installation_status = set_environment_dict.get( 'status', None ) else: installation_status = None tool_dependency = ToolDependency( id=tool_dependency_id, name=name, type=type, installation_status=installation_status, - repository_id=repository_id ) + repository_id=repository_id, + tool_dependency_id=td_id ) folder.tool_dependencies.append( tool_dependency ) else: name = requirements_dict[ 'name' ] version = requirements_dict[ 'version' ] type = requirements_dict[ 'type' ] install_dir = requirements_dict.get( 'install_dir', None ) + repository_id = requirements_dict.get( 'repository_id', None ) + td_id = requirements_dict.get( 'tool_dependency_id', None ) if display_status: - installation_status = requirements_dict[ 'status' ] + installation_status = requirements_dict.get( 'status', None ) else: installation_status = None tool_dependency = ToolDependency( id=tool_dependency_id, @@ -344,7 +348,8 @@ type=type, install_dir=install_dir, installation_status=installation_status, - repository_id=repository_id ) + repository_id=repository_id, + tool_dependency_id=td_id ) folder.tool_dependencies.append( tool_dependency ) else: tool_dependencies_root_folder = None diff -r c159eafdf9d3e97e12b7c9db53509f13842c5b96 -r 0a3e4bc2b5a510820b8aba73b78433db810a3481 templates/webapps/community/repository/common.mako --- a/templates/webapps/community/repository/common.mako +++ b/templates/webapps/community/repository/common.mako @@ -430,17 +430,15 @@ <${cell_type} style="padding-left: ${pad+20}px;"> %if row_is_header: ${tool_dependency.name | h} - %elif tool_dependency.repository_id: - %if not tool_dependency.installation_status: - ## tool_dependency.installation_status will be None if the status value in the database is 'Installed'. - <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='browse_tool_dependency', id=trans.security.encode_id( tool_dependency.id ), repository_id=trans.security.encode_id( tool_dependency.repository_id ) )}"> - ${tool_dependency.name | h} - </a> - %else: - <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='manage_tool_dependencies', id=trans.security.encode_id( tool_dependency.id ) )}"> - ${tool_dependency.name} - </a> - %endif + %elif trans.webapp.name == 'galaxy' and tool_dependency.tool_dependency_id and tool_dependency.repository_id and not tool_dependency.installation_status: + ## tool_dependency.installation_status will be None if the status value in the database is 'Installed'. + <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='browse_tool_dependency', id=trans.security.encode_id( tool_dependency.tool_dependency_id ), repository_id=trans.security.encode_id( tool_dependency.repository_id ) )}"> + ${tool_dependency.name | h} + </a> + %elif trans.webapp.name == 'galaxy' and tool_dependency.tool_dependency_id and tool_dependency.installation_status: + <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='manage_tool_dependencies', id=trans.security.encode_id( tool_dependency.tool_dependency_id ) )}"> + ${tool_dependency.name} + </a> %else: ${tool_dependency.name | h} %endif diff -r c159eafdf9d3e97e12b7c9db53509f13842c5b96 -r 0a3e4bc2b5a510820b8aba73b78433db810a3481 test/tool_shed/functional/test_1010_install_repository_with_tool_dependencies.py --- a/test/tool_shed/functional/test_1010_install_repository_with_tool_dependencies.py +++ b/test/tool_shed/functional/test_1010_install_repository_with_tool_dependencies.py @@ -62,9 +62,7 @@ self.browse_tool_shed( url=self.url, strings_displayed=[ 'Test 0010 Repository With Tool Dependencies' ] ) category = test_db_util.get_category_by_name( 'Test 0010 Repository With Tool Dependencies' ) self.browse_category( category, strings_displayed=[ 'freebayes_0010' ] ) - self.preview_repository_in_tool_shed( 'freebayes_0010', common.test_user_1_name, strings_displayed=[ 'freebayes_0010', - 'Valid tools', - 'Installed tool dependencies' ] ) + self.preview_repository_in_tool_shed( 'freebayes_0010', common.test_user_1_name, strings_displayed=[ 'freebayes_0010', 'Valid tools', 'Tool dependencies' ] ) def test_0015_install_freebayes_repository( self ): '''Install the freebayes repository without installing tool dependencies.''' strings_displayed=[ 'set your tool_dependency_dir', 'can be automatically installed', 'Set the tool_dependency_dir' ] Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.