commit/galaxy-central: greg: Fix for generating a repository dependency key when prior installation required is true.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/f7a2d117ad02/ Changeset: f7a2d117ad02 User: greg Date: 2013-05-02 17:57:42 Summary: Fix for generating a repository dependency key when prior installation required is true. Affected #: 2 files diff -r a26ec089b62fc2eb4824e738b7cc668b481de184 -r f7a2d117ad02430426fef338f991f063853c377e lib/tool_shed/util/repository_dependency_util.py --- a/lib/tool_shed/util/repository_dependency_util.py +++ b/lib/tool_shed/util/repository_dependency_util.py @@ -256,12 +256,34 @@ message = '%s ' % str( error ) return message -def get_key_for_repository_changeset_revision( toolshed_base_url, repository, repository_metadata ): - return container_util.generate_repository_dependencies_key_for_repository( toolshed_base_url=toolshed_base_url, - repository_name=repository.name, - repository_owner=repository.user.username, - changeset_revision=repository_metadata.changeset_revision, - prior_installation_required=False ) +def get_key_for_repository_changeset_revision( toolshed_base_url, repository, repository_metadata, all_repository_dependencies ): + prior_installation_required = get_prior_installation_required_for_key( toolshed_base_url, repository, repository_metadata, all_repository_dependencies ) + # Create a key with the value of prior_installation_required defaulted to False. + key = container_util.generate_repository_dependencies_key_for_repository( toolshed_base_url=toolshed_base_url, + repository_name=repository.name, + repository_owner=repository.user.username, + changeset_revision=repository_metadata.changeset_revision, + prior_installation_required=prior_installation_required ) + return key + +def get_prior_installation_required_for_key( toolshed_base_url, repository, repository_metadata, all_repository_dependencies ): + """ + If all_repository_dependencies contains a repository dependency tuple that is associated with the received repository, return the + value of the tuple's prior_installation_required component. + """ + rd_tuple = ( toolshed_base_url, repository.name, repository.user.username, repository_metadata.changeset_revision ) + for rd_key, rd_tups in all_repository_dependencies.items(): + if rd_key in [ 'root_key', 'description' ]: + continue + for rd_tup in rd_tups: + rd_toolshed, rd_name, rd_owner, rd_changeset_revision, rd_prior_installation_required = suc.parse_repository_dependency_tuple( rd_tup ) + if rd_toolshed == toolshed_base_url and \ + rd_name == repository.name and \ + rd_owner == repository.user.username and \ + rd_changeset_revision == repository_metadata.changeset_revision: + return rd_prior_installation_required + # Default prior_installation_required to False. + return False def get_repository_dependencies_for_changeset_revision( trans, repository, repository_metadata, toolshed_base_url, key_rd_dicts_to_be_processed=None, all_repository_dependencies=None, @@ -285,7 +307,7 @@ metadata = repository_metadata.metadata if metadata: if 'repository_dependencies' in metadata: - current_repository_key = get_key_for_repository_changeset_revision( toolshed_base_url, repository, repository_metadata ) + current_repository_key = get_key_for_repository_changeset_revision( toolshed_base_url, repository, repository_metadata, all_repository_dependencies ) repository_dependencies_dict = metadata[ 'repository_dependencies' ] if not all_repository_dependencies: all_repository_dependencies = initialize_all_repository_dependencies( current_repository_key, @@ -554,7 +576,7 @@ # Change the folder label from 'Missing repository dependencies' to be 'Repository dependencies' for display. root_container = containers_dict[ 'missing_repository_dependencies' ] for sub_container in root_container.folders: - # There should only be 1 subfolder. + # There should only be 1 sub-folder. sub_container.label = 'Repository dependencies' containers_dict[ 'repository_dependencies' ] = root_container containers_dict[ 'missing_repository_dependencies' ] = None @@ -608,8 +630,8 @@ def prune_invalid_repository_dependencies( repository_dependencies ): """ - Eliminate all invalid entries in the received repository_dependencies dictionary. An entry is invalid if if the value_list of the key/value pair is - empty. This occurs when an invalid combination of tool shed, name , owner, changeset_revision is used and a repository_metadata reocrd is not found. + Eliminate all invalid entries in the received repository_dependencies dictionary. An entry is invalid if the value_list of the key/value pair is + empty. This occurs when an invalid combination of tool shed, name , owner, changeset_revision is used and a repository_metadata record is not found. """ valid_repository_dependencies = {} description = repository_dependencies.get( 'description', None ) diff -r a26ec089b62fc2eb4824e738b7cc668b481de184 -r f7a2d117ad02430426fef338f991f063853c377e templates/webapps/tool_shed/repository/common.mako --- a/templates/webapps/tool_shed/repository/common.mako +++ b/templates/webapps/tool_shed/repository/common.mako @@ -980,6 +980,7 @@ </div> %endif %if tool_test_results_root_folder: + <p/><div class="toolForm"><div class="toolFormTitle">Automated tool test results</div><div class="toolFormBody"> 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.
participants (1)
-
commits-noreply@bitbucket.org