commit/galaxy-central: greg: Begin to reintroduce the ability to install multiple tool shed repositories into Galaxy simultaneously.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/3faa833c15b5/ changeset: 3faa833c15b5 user: greg date: 2013-01-11 17:47:59 summary: Begin to reintroduce the ability to install multiple tool shed repositories into Galaxy simultaneously. affected #: 16 files diff -r 753130def2f89698bb95a554ce76c7ea8c5102d7 -r 3faa833c15b5162db69f061bdbd4e951ba2ffdc7 lib/galaxy/util/shed_util.py --- a/lib/galaxy/util/shed_util.py +++ b/lib/galaxy/util/shed_util.py @@ -584,6 +584,68 @@ if converter_path and display_path: break return converter_path, display_path +def get_dependencies_for_repository( trans, tool_shed_url, repo_info_dict, includes_tool_dependencies ): + """ + Return dictionaries containing the sets of installed and missing tool dependencies and repository dependencies associated with the repository defined + by the received repo_info_dict. + """ + name = repo_info_dict.keys()[ 0 ] + repo_info_tuple = repo_info_dict[ name ] + description, repository_clone_url, changeset_revision, ctx_rev, repository_owner, repository_dependencies, installed_td = \ + suc.get_repo_info_tuple_contents( repo_info_tuple ) + if repository_dependencies: + missing_td = {} + # Handle the scenario where a repository was installed, then uninstalled and an error occurred during the reinstallation process. + # In this case, a record for the repository will exist in the database with the status of 'New'. + repository = suc.get_repository_for_dependency_relationship( trans.app, tool_shed_url, name, repository_owner, changeset_revision ) + if repository and repository.metadata: + installed_rd, missing_rd = \ + get_installed_and_missing_repository_dependencies( trans, repository ) + else: + installed_rd, missing_rd = \ + get_installed_and_missing_repository_dependencies_for_new_install( trans, repository_dependencies ) + # Discover all repository dependencies and retrieve information for installing them. + required_repo_info_dicts = get_required_repo_info_dicts( tool_shed_url, util.listify( repo_info_dict ) ) + # Display tool dependencies defined for each of the repository dependencies. + if required_repo_info_dicts: + all_tool_dependencies = {} + for rid in required_repo_info_dicts: + for name, repo_info_tuple in rid.items(): + description, repository_clone_url, changeset_revision, ctx_rev, repository_owner, repository_dependencies, rid_installed_td = \ + suc.get_repo_info_tuple_contents( repo_info_tuple ) + if rid_installed_td: + for td_key, td_dict in rid_installed_td.items(): + if td_key not in all_tool_dependencies: + all_tool_dependencies[ td_key ] = td_dict + if all_tool_dependencies: + if installed_td is None: + installed_td = {} + else: + # Move all tool dependencies to the missing_tool_dependencies container. + for td_key, td_dict in installed_td.items(): + if td_key not in missing_td: + missing_td[ td_key ] = td_dict + installed_td = {} + # Discover and categorize all tool dependencies defined for this repository's repository dependencies. + required_tool_dependencies, required_missing_tool_dependencies = \ + get_installed_and_missing_tool_dependencies_for_new_install( trans, all_tool_dependencies ) + if required_tool_dependencies: + if not includes_tool_dependencies: + includes_tool_dependencies = True + for td_key, td_dict in required_tool_dependencies.items(): + if td_key not in installed_td: + installed_td[ td_key ] = td_dict + if required_missing_tool_dependencies: + if not includes_tool_dependencies: + includes_tool_dependencies = True + for td_key, td_dict in required_missing_tool_dependencies.items(): + if td_key not in missing_td: + missing_td[ td_key ] = td_dict + else: + installed_rd = None + missing_rd = None + missing_td = None + return name, repository_owner, changeset_revision, includes_tool_dependencies, installed_rd, missing_rd, installed_td, missing_td def get_headers( fname, sep, count=60, is_multi_byte=False ): """Returns a list with the first 'count' lines split by 'sep'.""" headers = [] @@ -689,7 +751,11 @@ 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 ) + if tool_dependency.status: + tool_dependency_status = str( tool_dependency.status ) + else: + tool_dependency_status = 'Never installed' + td_info_dict[ 'status' ] = tool_dependency_status val[ index ] = td_info_dict if tool_dependency.status == trans.model.ToolDependency.installation_status.INSTALLED: tool_dependencies[ td_key ] = val @@ -703,7 +769,11 @@ 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: + tool_dependency_status = str( tool_dependency.status ) + else: + tool_dependency_status = 'Never installed' + val[ 'status' ] = tool_dependency_status if tool_dependency.status == trans.model.ToolDependency.installation_status.INSTALLED: tool_dependencies[ td_key ] = val else: @@ -728,18 +798,8 @@ tool_dependencies = None missing_tool_dependencies = None return tool_dependencies, missing_tool_dependencies -def get_repository_owner( cleaned_repository_url ): - items = cleaned_repository_url.split( 'repos' ) - repo_path = items[ 1 ] - if repo_path.startswith( '/' ): - repo_path = repo_path.replace( '/', '', 1 ) - return repo_path.lstrip( '/' ).split( '/' )[ 0 ] -def get_repository_owner_from_clone_url( repository_clone_url ): - tmp_url = suc.clean_repository_clone_url( repository_clone_url ) - tool_shed = tmp_url.split( 'repos' )[ 0 ].rstrip( '/' ) - return get_repository_owner( tmp_url ) -def get_repository_readme_and_dependencies_for_display( trans, tool_shed_url, repo_info_dict, includes_tool_dependencies ): - # If we're installing a single repository, see if it contains a readme or dependencies that we can display. +def get_readme_files_dict_for_display( trans, tool_shed_url, repo_info_dict ): + """Return a dictionary of README files contained in the single repository being installed so they can be displayed on the tool panel section selection page.""" name = repo_info_dict.keys()[ 0 ] repo_info_tuple = repo_info_dict[ name ] description, repository_clone_url, changeset_revision, ctx_rev, repository_owner, repository_dependencies, installed_td = \ @@ -752,59 +812,17 @@ raw_text = response.read() response.close() readme_files_dict = json.from_json_string( raw_text ) - if repository_dependencies: - missing_td = {} - # Handle the scenario where a repository was installed, then uninstalled and an error occurred during the reinstallation process. - # In this case, a record for the repository will exist in the database with the status of 'New'. - repository = suc.get_repository_for_dependency_relationship( trans.app, tool_shed_url, name, repository_owner, changeset_revision ) - if repository and repository.metadata: - installed_rd, missing_rd = \ - get_installed_and_missing_repository_dependencies( trans, repository ) - else: - installed_rd, missing_rd = \ - get_installed_and_missing_repository_dependencies_for_new_install( trans, repository_dependencies ) - # Discover all repository dependencies and retrieve information for installing them. - required_repo_info_dicts = get_required_repo_info_dicts( tool_shed_url, util.listify( repo_info_dict ) ) - # Display tool dependencies defined for each of the repository dependencies. - if required_repo_info_dicts: - all_tool_dependencies = {} - for rid in required_repo_info_dicts: - for name, repo_info_tuple in rid.items(): - description, repository_clone_url, changeset_revision, ctx_rev, repository_owner, repository_dependencies, rid_installed_td = \ - suc.get_repo_info_tuple_contents( repo_info_tuple ) - if rid_installed_td: - for td_key, td_dict in rid_installed_td.items(): - if td_key not in all_tool_dependencies: - all_tool_dependencies[ td_key ] = td_dict - if all_tool_dependencies: - if installed_td is None: - installed_td = {} - else: - # Move all tool dependencies to the missing_tool_dependencies container. - for td_key, td_dict in installed_td.items(): - if td_key not in missing_td: - missing_td[ td_key ] = td_dict - installed_td = {} - # Discover and categorize all tool dependencies defined for this repository's repository dependencies. - required_tool_dependencies, required_missing_tool_dependencies = \ - get_installed_and_missing_tool_dependencies_for_new_install( trans, all_tool_dependencies ) - if required_tool_dependencies: - if not includes_tool_dependencies: - includes_tool_dependencies = True - for td_key, td_dict in required_tool_dependencies.items(): - if td_key not in installed_td: - installed_td[ td_key ] = td_dict - if required_missing_tool_dependencies: - if not includes_tool_dependencies: - includes_tool_dependencies = True - for td_key, td_dict in required_missing_tool_dependencies.items(): - if td_key not in missing_td: - missing_td[ td_key ] = td_dict - else: - installed_rd = None - missing_rd = None - missing_td = None - return name, repository_owner, changeset_revision, readme_files_dict, includes_tool_dependencies, installed_rd, missing_rd, installed_td, missing_td + return readme_files_dict +def get_repository_owner( cleaned_repository_url ): + items = cleaned_repository_url.split( 'repos' ) + repo_path = items[ 1 ] + if repo_path.startswith( '/' ): + repo_path = repo_path.replace( '/', '', 1 ) + return repo_path.lstrip( '/' ).split( '/' )[ 0 ] +def get_repository_owner_from_clone_url( repository_clone_url ): + tmp_url = suc.clean_repository_clone_url( repository_clone_url ) + tool_shed = tmp_url.split( 'repos' )[ 0 ].rstrip( '/' ) + return get_repository_owner( tmp_url ) def get_required_repo_info_dicts( tool_shed_url, repo_info_dicts ): """ Inspect the list of repo_info_dicts for repository dependencies and append a repo_info_dict for each of them to the list. All @@ -1220,46 +1238,17 @@ installed_repository_dependencies, missing_repository_dependencies = get_installed_and_missing_repository_dependencies( trans, repository ) # Handle the current repository's tool dependencies. repository_tool_dependencies = metadata.get( 'tool_dependencies', None ) - repository_installed_tool_dependencies, repository_missing_tool_dependencies = \ - get_installed_and_missing_tool_dependencies( trans, repository, repository_tool_dependencies ) + repository_installed_tool_dependencies, repository_missing_tool_dependencies = get_installed_and_missing_tool_dependencies( trans, + repository, + repository_tool_dependencies ) if reinstalling: - installed_tool_dependencies = None - missing_tool_dependencies = None - if repository_installed_tool_dependencies is None: - repository_installed_tool_dependencies = {} - if repository_missing_tool_dependencies is None: - repository_missing_tool_dependencies = {} - if required_repo_info_dicts: - # Handle the tool dependencies defined for each of the repository's repository dependencies. - for rid in required_repo_info_dicts: - for name, repo_info_tuple in rid.items(): - description, repository_clone_url, changeset_revision, ctx_rev, repository_owner, repository_dependencies, tool_dependencies = \ - suc.get_repo_info_tuple_contents( repo_info_tuple ) - if tool_dependencies: - tool_shed = suc.get_tool_shed_from_clone_url( repository_clone_url ) - required_repository = suc.get_repository_for_dependency_relationship( trans.app, tool_shed, name, repository_owner, changeset_revision ) - if not required_repository: - # The required_repository may have been installed with a different changeset revision. - required_repository, installed_changeset_revision = repository_was_previously_installed( trans, - tool_shed_url, - name, - repo_info_tuple, - clone_dir ) - if required_repository: - required_repository_installed_tool_dependencies, required_repository_missing_tool_dependencies = \ - get_installed_and_missing_tool_dependencies( trans, required_repository, tool_dependencies ) - if required_repository_installed_tool_dependencies: - for td_key, td_dict in required_repository_installed_tool_dependencies.items(): - if td_key not in repository_installed_tool_dependencies: - repository_installed_tool_dependencies[ td_key ] = td_dict - if required_repository_missing_tool_dependencies: - for td_key, td_dict in required_repository_missing_tool_dependencies.items(): - if td_key not in repository_missing_tool_dependencies: - repository_missing_tool_dependencies[ td_key ] = td_dict - if repository_installed_tool_dependencies: - installed_tool_dependencies = repository_installed_tool_dependencies - if repository_missing_tool_dependencies: - missing_tool_dependencies = repository_missing_tool_dependencies + installed_tool_dependencies, missing_tool_dependencies = \ + populate_tool_dependencies_dicts( trans=trans, + tool_shed_url=tool_shed_url, + tool_path=tool_path, + repository_installed_tool_dependencies=repository_installed_tool_dependencies, + repository_missing_tool_dependencies=repository_missing_tool_dependencies, + required_repo_info_dicts=required_repo_info_dicts ) else: installed_tool_dependencies = repository_installed_tool_dependencies missing_tool_dependencies = repository_missing_tool_dependencies @@ -1268,10 +1257,6 @@ # Handle workflows. workflows = metadata.get( 'workflows', None ) containers_dict = suc.build_repository_containers_for_galaxy( trans=trans, - toolshed_base_url=tool_shed_url, - repository_name=repository.name, - repository_owner=repository.owner, - changeset_revision=repository.installed_changeset_revision, repository=repository, datatypes=datatypes, invalid_tools=invalid_tools, @@ -1293,6 +1278,95 @@ valid_tools=None, workflows=None ) return containers_dict +def populate_containers_dict_for_new_install( trans, tool_shed_url, tool_path, readme_files_dict, installed_repository_dependencies, missing_repository_dependencies, + installed_tool_dependencies, missing_tool_dependencies ): + """Return the populated containers for a repository being installed for the first time.""" + installed_tool_dependencies, missing_tool_dependencies = populate_tool_dependencies_dicts( trans=trans, + tool_shed_url=tool_shed_url, + tool_path=tool_path, + repository_installed_tool_dependencies=installed_tool_dependencies, + repository_missing_tool_dependencies=missing_tool_dependencies, + required_repo_info_dicts=None ) + # Since we are installing a new repository, most of the repository contents are set to None since we don't yet know what they are. + containers_dict = suc.build_repository_containers_for_galaxy( trans=trans, + repository=None, + datatypes=None, + invalid_tools=None, + missing_repository_dependencies=missing_repository_dependencies, + missing_tool_dependencies=missing_tool_dependencies, + readme_files_dict=readme_files_dict, + repository_dependencies=installed_repository_dependencies, + tool_dependencies=installed_tool_dependencies, + valid_tools=None, + workflows=None, + new_install=True, + reinstalling=False ) + # Merge the missing_repository_dependencies container contents to the installed_repository_dependencies container. + containers_dict = suc.merge_missing_repository_dependencies_to_installed_container( containers_dict ) + # Merge the missing_tool_dependencies container contents to the installed_tool_dependencies container. + containers_dict = suc.merge_missing_tool_dependencies_to_installed_container( containers_dict ) + return containers_dict +def populate_tool_dependencies_dicts( trans, tool_shed_url, tool_path, repository_installed_tool_dependencies, repository_missing_tool_dependencies, + required_repo_info_dicts ): + """ + Return the populated installed_tool_dependencies and missing_tool_dependencies dictionaries for all repositories defined by entries in the received + required_repo_info_dicts. + """ + installed_tool_dependencies = None + missing_tool_dependencies = None + if repository_installed_tool_dependencies is None: + repository_installed_tool_dependencies = {} + else: + # Add the install_dir attribute to the tool_dependencies. + repository_installed_tool_dependencies = suc.add_installation_directories_to_tool_dependencies( trans=trans, + tool_dependencies=repository_installed_tool_dependencies ) + if repository_missing_tool_dependencies is None: + repository_missing_tool_dependencies = {} + else: + # Add the install_dir attribute to the tool_dependencies. + repository_missing_tool_dependencies = suc.add_installation_directories_to_tool_dependencies( trans=trans, + tool_dependencies=repository_missing_tool_dependencies ) + if required_repo_info_dicts: + # Handle the tool dependencies defined for each of the repository's repository dependencies. + for rid in required_repo_info_dicts: + for name, repo_info_tuple in rid.items(): + description, repository_clone_url, changeset_revision, ctx_rev, repository_owner, repository_dependencies, tool_dependencies = \ + suc.get_repo_info_tuple_contents( repo_info_tuple ) + if tool_dependencies: + clone_dir = os.path.join( tool_path, generate_tool_path( repository_clone_url, changeset_revision ) ) + # Add the install_dir attribute to the tool_dependencies. + tool_dependencies = suc.add_installation_directories_to_tool_dependencies( trans=trans, + tool_dependencies=tool_dependencies ) + # The required_repository may have been installed with a different changeset revision. + required_repository, installed_changeset_revision = repository_was_previously_installed( trans, + tool_shed_url, + name, + repo_info_tuple, + clone_dir ) + if required_repository: + required_repository_installed_tool_dependencies, required_repository_missing_tool_dependencies = \ + get_installed_and_missing_tool_dependencies( trans, required_repository, tool_dependencies ) + if required_repository_installed_tool_dependencies: + # Add the install_dir attribute to the tool_dependencies. + required_repository_installed_tool_dependencies = \ + suc.add_installation_directories_to_tool_dependencies( trans=trans, + tool_dependencies=required_repository_installed_tool_dependencies ) + for td_key, td_dict in required_repository_installed_tool_dependencies.items(): + if td_key not in repository_installed_tool_dependencies: + repository_installed_tool_dependencies[ td_key ] = td_dict + if required_repository_missing_tool_dependencies: + # Add the install_dir attribute to the tool_dependencies. + required_repository_missing_tool_dependencies = \ + suc.add_installation_directories_to_tool_dependencies( trans=trans, + tool_dependencies=required_repository_missing_tool_dependencies ) + for td_key, td_dict in required_repository_missing_tool_dependencies.items(): + if td_key not in repository_missing_tool_dependencies: + repository_missing_tool_dependencies[ td_key ] = td_dict + if repository_installed_tool_dependencies: + installed_tool_dependencies = repository_installed_tool_dependencies + if repository_missing_tool_dependencies: + missing_tool_dependencies = repository_missing_tool_dependencies + return installed_tool_dependencies, missing_tool_dependencies def pull_repository( repo, repository_clone_url, ctx_rev ): """Pull changes from a remote repository to a local one.""" commands.pull( suc.get_configured_ui(), repo, source=repository_clone_url, rev=[ ctx_rev ] ) diff -r 753130def2f89698bb95a554ce76c7ea8c5102d7 -r 3faa833c15b5162db69f061bdbd4e951ba2ffdc7 lib/galaxy/util/shed_util_common.py --- a/lib/galaxy/util/shed_util_common.py +++ b/lib/galaxy/util/shed_util_common.py @@ -38,9 +38,17 @@ TOOL_SHED_ADMIN_CONTROLLER = 'TOOL_SHED_ADMIN_CONTROLLER' VALID_CHARS = set( string.letters + string.digits + "'\"-=_.()/+*^,:?!#[]%\\$@;{}" ) -def add_installation_directories_to_tool_dependencies( trans, repository_name, repository_owner, changeset_revision, tool_dependencies ): +def add_installation_directories_to_tool_dependencies( trans, tool_dependencies ): + """ + Determine the path to the installation directory for each of the received tool dependencies. This path will be displayed within the tool dependencies + container on the select_tool_panel_section or reselect_tool_panel_section pages when installing or reinstalling repositories that contain tools with the + defined tool dependencies. The list of tool dependencies may be associated with more than a single repository. + """ for dependency_key, requirements_dict in tool_dependencies.items(): if dependency_key not in [ 'set_environment' ]: + repository_name = requirements_dict[ 'repository_name' ] + repository_owner = requirements_dict[ 'repository_owner' ] + changeset_revision = requirements_dict[ 'changeset_revision' ] dependency_name = requirements_dict[ 'name' ] version = requirements_dict[ 'version' ] type = requirements_dict[ 'type' ] @@ -76,9 +84,9 @@ except Exception, e: log.debug( "Error reading README file '%s' defined in metadata: %s" % ( str( relative_path_to_readme_file ), str( e ) ) ) return readme_files_dict -def build_repository_containers_for_galaxy( trans, toolshed_base_url, repository_name, repository_owner, changeset_revision, repository, datatypes, - invalid_tools, missing_repository_dependencies, missing_tool_dependencies, readme_files_dict, - repository_dependencies, tool_dependencies, valid_tools, workflows, new_install=False, reinstalling=False ): +def build_repository_containers_for_galaxy( trans, repository, datatypes, invalid_tools, missing_repository_dependencies, missing_tool_dependencies, + readme_files_dict, repository_dependencies, tool_dependencies, valid_tools, workflows, new_install=False, + reinstalling=False ): """Return a dictionary of containers for the received repository's dependencies and readme files for display during installation to Galaxy.""" containers_dict = dict( datatypes=None, invalid_tools=None, @@ -93,17 +101,12 @@ # id. However we need to be careful because sometimes the repository object is None. if repository: repository_id = repository.id + changeset_revision = repository.changeset_revision else: repository_id = None + changeset_revision = None lock = threading.Lock() lock.acquire( True ) - if tool_dependencies: - # Add the install_dir attribute to the tool_dependencies. - tool_dependencies = add_installation_directories_to_tool_dependencies( trans, - repository_name, - repository_owner, - changeset_revision, - tool_dependencies ) try: folder_id = 0 # Datatypes container. @@ -126,10 +129,6 @@ # Installed repository dependencies container. if repository_dependencies: folder_id, repository_dependencies_root_folder = container_util.build_repository_dependencies_folder( trans=trans, - toolshed_base_url=toolshed_base_url, - repository_name=repository_name, - repository_owner=repository_owner, - changeset_revision=changeset_revision, folder_id=folder_id, repository_dependencies=repository_dependencies, label='Installed repository dependencies', @@ -139,10 +138,6 @@ if missing_repository_dependencies: folder_id, missing_repository_dependencies_root_folder = \ container_util.build_repository_dependencies_folder( trans=trans, - toolshed_base_url=toolshed_base_url, - repository_name=repository_name, - repository_owner=repository_owner, - changeset_revision=changeset_revision, folder_id=folder_id, repository_dependencies=missing_repository_dependencies, label='Missing repository dependencies', @@ -236,12 +231,7 @@ folder_id, readme_files_root_folder = container_util.build_readme_files_folder( trans, folder_id, readme_files_dict ) containers_dict[ 'readme_files' ] = readme_files_root_folder # Repository dependencies container. - toolshed_base_url = str( url_for( '/', qualified=True ) ).rstrip( '/' ) folder_id, repository_dependencies_root_folder = container_util.build_repository_dependencies_folder( trans=trans, - toolshed_base_url=toolshed_base_url, - repository_name=repository.name, - repository_owner=repository.user.username, - changeset_revision=changeset_revision, folder_id=folder_id, repository_dependencies=repository_dependencies, label='Repository dependencies', @@ -816,6 +806,27 @@ all_repository_dependencies=None, handled_key_rd_dicts=None, circular_repository_dependencies=None ) + if metadata: + tool_dependencies = metadata.get( 'tool_dependencies', None ) + if tool_dependencies: + new_tool_dependencies = {} + for dependency_key, requirements_dict in tool_dependencies.items(): + if dependency_key in [ 'set_environment' ]: + new_set_environment_dict_list = [] + for set_environment_dict in requirements_dict: + set_environment_dict[ 'repository_name' ] = repository_name + set_environment_dict[ 'repository_owner' ] = repository_owner + set_environment_dict[ 'changeset_revision' ] = changeset_revision + new_set_environment_dict_list.append( set_environment_dict ) + new_tool_dependencies[ dependency_key ] = new_set_environment_dict_list + else: + requirements_dict[ 'repository_name' ] = repository_name + requirements_dict[ 'repository_owner' ] = repository_owner + requirements_dict[ 'changeset_revision' ] = changeset_revision + new_tool_dependencies[ dependency_key ] = requirements_dict + tool_dependencies = new_tool_dependencies + else: + tool_dependencies = None # Cast unicode to string. repo_info_dict[ str( repository.name ) ] = ( str( repository.description ), str( repository_clone_url ), @@ -823,7 +834,7 @@ str( ctx_rev ), str( repository_owner ), repository_dependencies, - metadata.get( 'tool_dependencies', None ) ) + tool_dependencies ) return repo_info_dict def ensure_required_repositories_exist_for_reinstall( trans, repository_dependencies ): """ @@ -1900,14 +1911,12 @@ for shed_tool_conf_dict in trans.app.toolbox.shed_tool_confs: config_filename = shed_tool_conf_dict[ 'config_filename' ] if config_filename == shed_tool_conf: - tool_path = shed_tool_conf_dict[ 'tool_path' ] - break + return shed_tool_conf_dict[ 'tool_path' ] else: file_name = strip_path( config_filename ) if file_name == shed_tool_conf: - tool_path = shed_tool_conf_dict[ 'tool_path' ] - break - return tool_path + return shed_tool_conf_dict[ 'tool_path' ] + return None def get_tool_shed_repository_by_id( trans, repository_id ): return trans.sa_session.query( trans.model.ToolShedRepository ) \ .filter( trans.model.ToolShedRepository.table.c.id == trans.security.decode_id( repository_id ) ) \ @@ -2308,6 +2317,33 @@ containers_dict[ 'repository_dependencies' ] = root_container containers_dict[ 'missing_repository_dependencies' ] = None return containers_dict +def merge_missing_tool_dependencies_to_installed_container( containers_dict ): + """ Merge the list of missing tool dependencies into the list of installed tool dependencies.""" + missing_td_container_root = containers_dict.get( 'missing_tool_dependencies', None ) + if missing_td_container_root: + # The missing_td_container_root will be a root folder containing a single sub_folder. + missing_td_container = missing_td_container_root.folders[ 0 ] + installed_td_container_root = containers_dict.get( 'tool_dependencies', None ) + # The installed_td_container_root will be a root folder containing a single sub_folder. + if installed_td_container_root: + installed_td_container = installed_td_container_root.folders[ 0 ] + installed_td_container.label = 'Tool dependencies' + for index, td in enumerate( missing_td_container.tool_dependencies ): + # Skip the header row. + if index == 0: + continue + installed_td_container.tool_dependencies.append( td ) + installed_td_container_root.folders = [ installed_td_container ] + containers_dict[ 'tool_dependencies' ] = installed_td_container_root + else: + # Change the folder label from 'Missing tool dependencies' to be 'Tool dependencies' for display. + root_container = containers_dict[ 'missing_tool_dependencies' ] + for sub_container in root_container.folders: + # There should only be 1 subfolder. + sub_container.label = 'Tool dependencies' + containers_dict[ 'tool_dependencies' ] = root_container + containers_dict[ 'missing_tool_dependencies' ] = None + return containers_dict def open_repository_files_folder( trans, folder_path ): try: files_list = get_repository_files( trans, folder_path ) @@ -2417,15 +2453,6 @@ error_message = '' return removed, error_message def repository_dependencies_have_tool_dependencies( trans, repository_dependencies ): - """ - repository_dependencies': - {'http://localhost:9009__ESEP__emboss_6__ESEP__test__ESEP__92bedb60b0c9': - [['http://localhost:9009', 'emboss_datatypes', 'test', '27df73fe48a6']], - 'root_key': 'http://localhost:9009__ESEP__emboss__ESEP__test__ESEP__06d729cb3f34', - 'description': 'required to enable emboss 6 tools', - 'http://localhost:9009__ESEP__emboss__ESEP__test__ESEP__06d729cb3f34': - [['http://localhost:9009', 'emboss_6', 'test', '92bedb60b0c9']]}} - """ rd_tups_processed = [] for key, rd_tups in repository_dependencies.items(): if key in [ 'root_key', 'description' ]: diff -r 753130def2f89698bb95a554ce76c7ea8c5102d7 -r 3faa833c15b5162db69f061bdbd4e951ba2ffdc7 lib/galaxy/webapps/community/controllers/repository.py --- a/lib/galaxy/webapps/community/controllers/repository.py +++ b/lib/galaxy/webapps/community/controllers/repository.py @@ -480,7 +480,9 @@ model_class=model.User, attach_popup=False ) ] - operations = [] + operations = [ + grids.GridOperation( "Install to Galaxy", allow_multiple=True ) + ] standard_filters = [] default_filter = {} num_rows_per_page = 50 @@ -1101,7 +1103,7 @@ return trans.response.send_redirect( web.url_for( controller='repository', action=a, **kwd ) ) - if operation == "install": + if operation == "install to galaxy": # We've received a list of RepositoryMetadata ids, so we need to build a list of associated Repository ids. encoded_repository_ids = [] changeset_revisions = [] @@ -1109,6 +1111,7 @@ repository_metadata = suc.get_repository_metadata_by_id( trans, repository_metadata_id ) encoded_repository_ids.append( trans.security.encode_id( repository_metadata.repository.id ) ) changeset_revisions.append( repository_metadata.changeset_revision ) + new_kwd = {} new_kwd[ 'repository_ids' ] = encoded_repository_ids new_kwd[ 'changeset_revisions' ] = changeset_revisions return trans.response.send_redirect( web.url_for( controller='repository', @@ -1186,7 +1189,7 @@ return trans.response.send_redirect( web.url_for( controller='repository', action=a, **kwd ) ) - if operation == "install": + if operation == "install to galaxy": # We've received a list of RepositoryMetadata ids, so we need to build a list of associated Repository ids. encoded_repository_ids = [] changeset_revisions = [] @@ -1372,8 +1375,8 @@ @web.json def get_repository_information( self, trans, repository_ids, changeset_revisions, **kwd ): """ - Generate a list of dictionaries, each of which contains the information about a repository that will be necessary for installing - it into a local Galaxy instance. + Generate a list of dictionaries, each of which contains the information about a repository that will be necessary for installing it into + a local Galaxy instance. """ includes_tools = False includes_repository_dependencies = False diff -r 753130def2f89698bb95a554ce76c7ea8c5102d7 -r 3faa833c15b5162db69f061bdbd4e951ba2ffdc7 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 @@ -211,8 +211,7 @@ else: readme_files_root_folder = None return folder_id, readme_files_root_folder -def build_repository_dependencies_folder( trans, toolshed_base_url, repository_name, repository_owner, changeset_revision, folder_id, repository_dependencies, - label='Repository dependencies', installed=False ): +def build_repository_dependencies_folder( trans, folder_id, repository_dependencies, label='Repository dependencies', installed=False ): """Return a folder hierarchy containing repository dependencies.""" if repository_dependencies: repository_dependency_id = 0 @@ -293,10 +292,10 @@ return folder_id, tools_root_folder def build_tool_dependencies_folder( trans, folder_id, tool_dependencies, label='Tool dependencies', missing=False, new_install=False, reinstalling=False ): """Return a folder hierarchy containing tool dependencies.""" - # The status will be displayed only if the received value for missing is True. When this is the case, we're in Galaxy (not the tool shed) - # and the tool dependencies are not installed or are in an error state, so they are considered missing. The tool dependency status will be - # displayed only if a record exists for the tool dependency in the database, but the tool dependency is not installed. The value for new_install - # will be True only if the associated repository in being installed for the first time. This value is used in setting the container description. + # When we're in Galaxy (not the tool shed) and the tool dependencies are not installed or are in an error state, they are considered missing. The tool + # dependency status will be displayed only if a record exists for the tool dependency in the Galaxy database, but the tool dependency is not installed. + # The value for new_install will be True only if the associated repository in being installed for the first time. This value is used in setting the + # container description. if tool_dependencies: tool_dependency_id = 0 folder_id += 1 @@ -304,15 +303,12 @@ folder_id += 1 folder = Folder( id=folder_id, key='tool_dependencies', label=label, parent=tool_dependencies_root_folder ) if trans.webapp.name == 'galaxy': - if reinstalling: - folder.description = "this repository's tools require handling of these dependencies" - elif missing and not reinstalling: + if new_install or reinstalling: + folder.description = "repository tools require handling of these dependencies" + elif missing and not new_install and not reinstalling: folder.description = 'click the name to install the missing dependency' else: - if new_install: - folder.description = "this repository's tools require handling of these dependencies" - else: - folder.description = 'click the name to browse the dependency installation directory' + folder.description = 'click the name to browse the dependency installation directory' tool_dependencies_root_folder.folders.append( folder ) # Insert a header row. tool_dependency_id += 1 @@ -321,11 +317,9 @@ tool_dependency = ToolDependency( id=tool_dependency_id, name='Name', version='Version', - type='Type' ) - if missing: - tool_dependency.installation_status = 'Status' - else: - tool_dependency.install_dir = 'Install directory' + type='Type', + install_dir='Install directory', + installation_status='Installation status' ) else: tool_dependency = ToolDependency( id=tool_dependency_id, name='Name', @@ -341,7 +335,7 @@ repository_id = set_environment_dict.get( 'repository_id', None ) td_id = set_environment_dict.get( 'tool_dependency_id', None ) if trans.webapp.name == 'galaxy': - installation_status = set_environment_dict.get( 'status', None ) + installation_status = set_environment_dict.get( 'status', 'Never installed' ) else: installation_status = None tool_dependency = ToolDependency( id=tool_dependency_id, @@ -359,7 +353,7 @@ repository_id = requirements_dict.get( 'repository_id', None ) td_id = requirements_dict.get( 'tool_dependency_id', None ) if trans.webapp.name == 'galaxy': - installation_status = requirements_dict.get( 'status', None ) + installation_status = requirements_dict.get( 'status', 'Never installed' ) else: installation_status = None tool_dependency = ToolDependency( id=tool_dependency_id, diff -r 753130def2f89698bb95a554ce76c7ea8c5102d7 -r 3faa833c15b5162db69f061bdbd4e951ba2ffdc7 lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py --- a/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py +++ b/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py @@ -946,7 +946,12 @@ trans.sa_session.add( repository ) trans.sa_session.flush() message = "The repository information has been updated." - containers_dict = shed_util.populate_containers_dict_from_repository_metadata( trans, tool_shed_url, tool_path, repository, reinstalling=False ) + containers_dict = shed_util.populate_containers_dict_from_repository_metadata( trans=trans, + tool_shed_url=tool_shed_url, + tool_path=tool_path, + repository=repository, + reinstalling=False, + required_repo_info_dicts=None ) return trans.fill_template( '/admin/tool_shed_repository/manage_repository.mako', repository=repository, description=description, @@ -1259,46 +1264,49 @@ shed_tool_conf = shed_tool_conf_dict[ 'config_filename' ] shed_tool_conf = shed_tool_conf.replace( './', '', 1 ) shed_tool_conf_select_field = None + tool_path = suc.get_tool_path_by_shed_tool_conf_filename( trans, shed_tool_conf ) tool_panel_section_select_field = build_tool_panel_section_select_field( trans ) + containers_dicts = [] if len( repo_info_dicts ) == 1: # If we're installing a single repository, see if it contains a readme or dependencies that we can display. repo_info_dict = repo_info_dicts[ 0 ] - name, repository_owner, changeset_revision, readme_files_dict, includes_tool_dependencies, \ - installed_repository_dependencies, missing_repository_dependencies, tool_dependencies, missing_tool_dependencies = \ - shed_util.get_repository_readme_and_dependencies_for_display( trans, tool_shed_url, repo_info_dict, includes_tool_dependencies ) - # Since we are installing a new repository, most of the repository contents are set to None since we don't yet know what they are. - containers_dict = suc.build_repository_containers_for_galaxy( trans=trans, - toolshed_base_url=tool_shed_url, - repository_name=name, - repository_owner=repository_owner, - changeset_revision=changeset_revision, - repository=None, - datatypes=None, - invalid_tools=None, - missing_repository_dependencies=missing_repository_dependencies, - missing_tool_dependencies=missing_tool_dependencies, - readme_files_dict=readme_files_dict, - repository_dependencies=installed_repository_dependencies, - tool_dependencies=tool_dependencies, - valid_tools=None, - workflows=None, - new_install=True, - reinstalling=False ) + name, repository_owner, changeset_revision, includes_tool_dependencies, installed_repository_dependencies, \ + missing_repository_dependencies, installed_tool_dependencies, missing_tool_dependencies = \ + shed_util.get_dependencies_for_repository( trans, tool_shed_url, repo_info_dict, includes_tool_dependencies ) + readme_files_dict = shed_util.get_readme_files_dict_for_display( trans, tool_shed_url, repo_info_dict ) # We're handling 1 of 2 scenarios here: (1) we're installing a tool shed repository for the first time, so we've retrieved the list of installed # and missing repository dependencies from the database (2) we're handling the scenario where an error occurred during the installation process, # so we have a tool_shed_repository record in the database with associated repository dependency records. Since we have the repository # dependencies in either case, we'll merge the list of missing repository dependencies into the list of installed repository dependencies since # each displayed repository dependency will display a status, whether installed or missing. - containers_dict = suc.merge_missing_repository_dependencies_to_installed_container( containers_dict ) + containers_dict = shed_util.populate_containers_dict_for_new_install( trans=trans, + tool_shed_url=tool_shed_url, + tool_path=tool_path, + readme_files_dict=readme_files_dict, + installed_repository_dependencies=installed_repository_dependencies, + missing_repository_dependencies=missing_repository_dependencies, + installed_tool_dependencies=installed_tool_dependencies, + missing_tool_dependencies=missing_tool_dependencies ) + containers_dicts.append( containers_dict ) else: - # FIXME: support the intallation of repository dependencies and tool dependencies for a list of tool shed repositories being installed. - containers_dict = dict( datatypes=None, - invalid_tools=None, - readme_files_dict=None, - repository_dependencies=None, - tool_dependencies=None, - valid_tools=None, - workflows=None ) + # We're installing a list of repositories, each of which may have tool dependencies or repository dependencies. + all_installed_repository_dependencies = [] + all_missing_repository_dependencies = [] + all_installed_tool_dependencies = [] + all_missing_tool_dependencies = [] + for repo_info_dict in repo_info_dicts: + name, repository_owner, changeset_revision, includes_tool_dependencies, installed_repository_dependencies, \ + missing_repository_dependencies, installed_tool_dependencies, missing_tool_dependencies = \ + shed_util.get_dependencies_for_repository( trans, tool_shed_url, repo_info_dict, includes_tool_dependencies ) + containers_dict = shed_util.populate_containers_dict_for_new_install( trans=trans, + tool_shed_url=tool_shed_url, + tool_path=tool_path, + readme_files_dict=None, + repository_dependencies=installed_repository_dependencies, + missing_repository_dependencies=missing_repository_dependencies, + tool_dependencies=installed_tool_dependencies, + missing_tool_dependencies=missing_tool_dependencies ) + containers_dicts.append( containers_dict ) # Handle tool dependencies chack box. if trans.app.config.tool_dependency_dir is None: if includes_tool_dependencies: @@ -1319,7 +1327,7 @@ includes_repository_dependencies=includes_repository_dependencies, install_repository_dependencies_check_box=install_repository_dependencies_check_box, new_tool_panel_section=new_tool_panel_section, - containers_dict=containers_dict, + containers_dicts=containers_dicts, shed_tool_conf=shed_tool_conf, shed_tool_conf_select_field=shed_tool_conf_select_field, tool_panel_section_select_field=tool_panel_section_select_field, @@ -1667,8 +1675,13 @@ message ++ "from the installed repository's <b>Repository Actions</b> menu. " status = 'error' shed_tool_conf, tool_path, relative_install_dir = suc.get_tool_panel_config_tool_path_install_dir( trans.app, repository ) - repo_files_dir = os.path.abspath( os.path.join( relative_install_dir, repository.name ) ) - containers_dict = shed_util.populate_containers_dict_from_repository_metadata( trans, tool_shed_url, tool_path, repository, reinstalling=False ) + repo_files_dir = os.path.abspath( os.path.join( relative_install_dir, repository.name ) ) + containers_dict = shed_util.populate_containers_dict_from_repository_metadata( trans=trans, + tool_shed_url=tool_shed_url, + tool_path=tool_path, + repository=repository, + reinstalling=False, + required_repo_info_dicts=None ) return trans.fill_template( '/admin/tool_shed_repository/manage_repository.mako', repository=repository, description=repository.description, diff -r 753130def2f89698bb95a554ce76c7ea8c5102d7 -r 3faa833c15b5162db69f061bdbd4e951ba2ffdc7 templates/admin/tool_shed_repository/select_tool_panel_section.mako --- a/templates/admin/tool_shed_repository/select_tool_panel_section.mako +++ b/templates/admin/tool_shed_repository/select_tool_panel_section.mako @@ -20,18 +20,25 @@ # this case, the repository metadata is an empty dictionary, but one or both of includes_repository_dependencies # and includes_tool_dependencies may be True. If either of these are True but we have no metadata, we cannot install # repository dependencies on this pass. - if includes_repository_dependencies: - repository_dependencies = containers_dict[ 'repository_dependencies' ] - missing_repository_dependencies = containers_dict[ 'missing_repository_dependencies' ] - can_display_repository_dependencies = repository_dependencies or missing_repository_dependencies - else: - can_display_repository_dependencies = False - if includes_tool_dependencies: - tool_dependencies = containers_dict[ 'tool_dependencies' ] - missing_tool_dependencies = containers_dict[ 'missing_tool_dependencies' ] - can_display_tool_dependencies = tool_dependencies or missing_tool_dependencies - else: - can_display_tool_dependencies = False + + # TODO: do we need this? + can_display_repository_dependencies = False + can_display_tool_dependencies = False + + if includes_repository_dependencies and not can_display_repository_dependencies: + for containers_dict in containers_dicts: + repository_dependencies = containers_dict[ 'repository_dependencies' ] + missing_repository_dependencies = containers_dict[ 'missing_repository_dependencies' ] + if repository_dependencies or missing_repository_dependencies: + can_display_repository_dependencies = True + break + if includes_tool_dependencies and not can_display_tool_dependencies: + for containers_dict in containers_dicts: + tool_dependencies = containers_dict[ 'tool_dependencies' ] + missing_tool_dependencies = containers_dict[ 'missing_tool_dependencies' ] + if tool_dependencies or missing_tool_dependencies: + can_display_tool_dependencies = True + break %> %if message: @@ -56,7 +63,14 @@ <div class="toolFormBody"><form name="select_tool_panel_section" id="select_tool_panel_section" action="${h.url_for( controller='admin_toolshed', action='prepare_for_install', tool_shed_url=tool_shed_url, encoded_repo_info_dicts=encoded_repo_info_dicts, includes_tools=includes_tools, includes_tool_dependencies=includes_tool_dependencies )}" method="post" ><div style="clear: both"></div> - <% readme_files_dict = containers_dict.get( 'readme_files', None ) %> + <% + if len( containers_dicts ) == 1: + containers_dict = containers_dicts[ 0 ] + readme_files_dict = containers_dict.get( 'readme_files', None ) + else: + containers_dict = None + readme_files_dict = None + %> %if readme_files_dict: <div class="form-row"><table class="colored" width="100%"> @@ -72,8 +86,15 @@ <th bgcolor="#EBD9B2">Confirm dependency installation</th></table></div> - ${render_dependencies_section( install_repository_dependencies_check_box, install_tool_dependencies_check_box, containers_dict )} - <div style="clear: both"></div> + %for index, containers_dict in enumerate( containers_dicts ): + %if index == 0: + ${render_dependencies_section( install_repository_dependencies_check_box, install_tool_dependencies_check_box, containers_dict )} + <div style="clear: both"></div> + %else: + ${render_dependencies_section( None, None, containers_dict )} + <div style="clear: both"></div> + %endif + %endfor %endif <div class="form-row"><table class="colored" width="100%"> diff -r 753130def2f89698bb95a554ce76c7ea8c5102d7 -r 3faa833c15b5162db69f061bdbd4e951ba2ffdc7 templates/webapps/community/repository/common.mako --- a/templates/webapps/community/repository/common.mako +++ b/templates/webapps/community/repository/common.mako @@ -207,13 +207,13 @@ if folder.description: folder_label = "%s<i> - %s</i>" % ( folder_label, folder.description ) else: - folder_label = "%s<i> - this repository's tools require handling of these missing dependencies</i>" % folder_label + folder_label = "%s<i> - repository tools require handling of these missing dependencies</i>" % folder_label col_span_str = 'colspan="5"' elif folder.label in [ 'Installed repository dependencies', 'Repository dependencies', 'Missing repository dependencies' ]: if folder.description: folder_label = "%s<i> - %s</i>" % ( folder_label, folder.description ) - else: - folder_label = "%s<i> - this repository requires installation of these additional repositories</i>" % folder_label + elif folder.label not in [ 'Installed repository dependencies' ]: + folder_label = "%s<i> - installation of these additional repositories is required</i>" % folder_label if trans.webapp.name == 'galaxy': col_span_str = 'colspan="4"' elif folder.label == 'Valid tools': @@ -228,7 +228,7 @@ if folder.description: folder_label = "%s<i> - %s</i>" % ( folder_label, folder.description ) else: - folder_label = "%s<i> - this repository's tools require handling of these dependencies</i>" % folder_label + folder_label = "%s<i> - repository tools require handling of these dependencies</i>" % folder_label col_span_str = 'colspan="4"' elif folder.workflows: if folder.description: @@ -467,6 +467,7 @@ <%def name="render_tool_dependency( tool_dependency, pad, parent, row_counter, row_is_header )"><% encoded_id = trans.security.encode_id( tool_dependency.id ) + is_missing = tool_dependency.installation_status not in [ 'Installed' ] if row_is_header: cell_type = 'th' else: @@ -506,12 +507,11 @@ ${version_str | h} </${cell_type}><${cell_type}>${tool_dependency.type | h}</${cell_type}> - %if tool_dependency.install_dir: + %if is_missing: + <${cell_type}>${tool_dependency.installation_status | h}</${cell_type}> + %elif tool_dependency.install_dir: <${cell_type}>${tool_dependency.install_dir | h}</${cell_type}> %endif - %if tool_dependency.installation_status not in [ 'Installed', None ]: - <${cell_type}>${tool_dependency.installation_status | h}</${cell_type}> - %endif </tr><% my_row = row_counter.count diff -r 753130def2f89698bb95a554ce76c7ea8c5102d7 -r 3faa833c15b5162db69f061bdbd4e951ba2ffdc7 templates/webapps/community/repository/preview_tools_in_changeset.mako --- a/templates/webapps/community/repository/preview_tools_in_changeset.mako +++ b/templates/webapps/community/repository/preview_tools_in_changeset.mako @@ -41,7 +41,7 @@ <br/><br/><ul class="manage-table-actions"> - <li><a class="action-button" href="${h.url_for( controller='repository', action='install_repositories_by_revision', repository_ids=trans.security.encode_id( repository.id ), changeset_revisions=changeset_revision )}">Install to local Galaxy</a></li> + <li><a class="action-button" href="${h.url_for( controller='repository', action='install_repositories_by_revision', repository_ids=trans.security.encode_id( repository.id ), changeset_revisions=changeset_revision )}">Install to Galaxy</a></li><li><a class="action-button" id="repository-${repository.id}-popup" class="menubutton">Tool Shed Actions</a></li><div popupmenu="repository-${repository.id}-popup"><a class="action-button" href="${h.url_for( controller='repository', action='browse_valid_categories' )}">Browse valid repositories</a> diff -r 753130def2f89698bb95a554ce76c7ea8c5102d7 -r 3faa833c15b5162db69f061bdbd4e951ba2ffdc7 templates/webapps/community/repository/tool_form.mako --- a/templates/webapps/community/repository/tool_form.mako +++ b/templates/webapps/community/repository/tool_form.mako @@ -124,7 +124,7 @@ %if trans.webapp.name == 'galaxy': <li><a class="action-button" id="repository-${repository.id}-popup" class="menubutton">Repository Actions</a></li><div popupmenu="repository-${repository.id}-popup"> - <li><a class="action-button" href="${h.url_for( controller='repository', action='install_repositories_by_revision', repository_ids=trans.security.encode_id( repository.id ), changeset_revisions=changeset_revision )}">Install to local Galaxy</a></li> + <li><a class="action-button" href="${h.url_for( controller='repository', action='install_repositories_by_revision', repository_ids=trans.security.encode_id( repository.id ), changeset_revisions=changeset_revision )}">Install to Galaxy</a></li><li><a class="action-button" href="${h.url_for( controller='repository', action='preview_tools_in_changeset', repository_id=trans.security.encode_id( repository.id ), changeset_revision=changeset_revision )}">Browse repository</a></li></div><li><a class="action-button" id="tool_shed-${repository.id}-popup" class="menubutton">Tool Shed Actions</a></li> diff -r 753130def2f89698bb95a554ce76c7ea8c5102d7 -r 3faa833c15b5162db69f061bdbd4e951ba2ffdc7 templates/webapps/community/repository/view_repository.mako --- a/templates/webapps/community/repository/view_repository.mako +++ b/templates/webapps/community/repository/view_repository.mako @@ -94,7 +94,7 @@ %endif %endif %else: - <li><a class="action-button" href="${h.url_for( controller='repository', action='install_repositories_by_revision', repository_ids=trans.security.encode_id( repository.id ), changeset_revisions=changeset_revision )}">Install to local Galaxy</a></li> + <li><a class="action-button" href="${h.url_for( controller='repository', action='install_repositories_by_revision', repository_ids=trans.security.encode_id( repository.id ), changeset_revisions=changeset_revision )}">Install to Galaxy</a></li><li><a class="action-button" id="repository-${repository.id}-popup" class="menubutton">Tool Shed Actions</a></li><div popupmenu="repository-${repository.id}-popup"><a class="action-button" href="${h.url_for( controller='repository', action='browse_valid_categories' )}">Browse valid repositories</a> diff -r 753130def2f89698bb95a554ce76c7ea8c5102d7 -r 3faa833c15b5162db69f061bdbd4e951ba2ffdc7 templates/webapps/community/repository/view_tool_metadata.mako --- a/templates/webapps/community/repository/view_tool_metadata.mako +++ b/templates/webapps/community/repository/view_tool_metadata.mako @@ -43,7 +43,7 @@ %if trans.webapp.name == 'galaxy': <li><a class="action-button" id="repository-${repository.id}-popup" class="menubutton">Repository Actions</a></li><div popupmenu="repository-${repository.id}-popup"> - <li><a class="action-button" href="${h.url_for( controller='repository', action='install_repositories_by_revision', repository_ids=trans.security.encode_id( repository.id ), changeset_revisions=changeset_revision )}">Install to local Galaxy</a></li> + <li><a class="action-button" href="${h.url_for( controller='repository', action='install_repositories_by_revision', repository_ids=trans.security.encode_id( repository.id ), changeset_revisions=changeset_revision )}">Install to Galaxy</a></li><li><a class="action-button" href="${h.url_for( controller='repository', action='preview_tools_in_changeset', repository_id=trans.security.encode_id( repository.id ), changeset_revision=changeset_revision )}">Browse repository</a></li></div><li><a class="action-button" id="tool_shed-${repository.id}-popup" class="menubutton">Tool Shed Actions</a></li> diff -r 753130def2f89698bb95a554ce76c7ea8c5102d7 -r 3faa833c15b5162db69f061bdbd4e951ba2ffdc7 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 @@ -72,7 +72,7 @@ self.preview_repository_in_tool_shed( repository_name, common.test_user_1_name, strings_displayed=strings_displayed ) 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' ] + strings_displayed=[ 'Never installed', 'can be automatically installed', 'Set the tool_dependency_dir' ] strings_displayed.extend( [ 'Handle', 'tool dependencies', 'freebayes', '0.9.4_9696d0ce8a9', 'samtools', '0.1.18' ] ) self.install_repository( repository_name, common.test_user_1_name, diff -r 753130def2f89698bb95a554ce76c7ea8c5102d7 -r 3faa833c15b5162db69f061bdbd4e951ba2ffdc7 test/tool_shed/functional/test_1020_install_repository_with_repository_dependencies.py --- a/test/tool_shed/functional/test_1020_install_repository_with_repository_dependencies.py +++ b/test/tool_shed/functional/test_1020_install_repository_with_repository_dependencies.py @@ -74,7 +74,7 @@ '''Install the emboss repository without installing tool dependencies.''' global repository_datatypes_count global base_datatypes_count - strings_displayed = [ 'Handle', 'Missing', 'tool dependencies', 'emboss', '5.0.0', 'package' ] + strings_displayed = [ 'Handle', 'Never installed', 'tool dependencies', 'emboss', '5.0.0', 'package' ] self.install_repository( 'emboss_0020', common.test_user_1_name, 'Test 0020 Basic Repository Dependencies', diff -r 753130def2f89698bb95a554ce76c7ea8c5102d7 -r 3faa833c15b5162db69f061bdbd4e951ba2ffdc7 test/tool_shed/functional/test_1030_install_repository_with_dependency_revisions.py --- a/test/tool_shed/functional/test_1030_install_repository_with_dependency_revisions.py +++ b/test/tool_shed/functional/test_1030_install_repository_with_dependency_revisions.py @@ -113,7 +113,7 @@ global base_datatypes_count global running_standalone base_datatypes_count = int( self.get_datatypes_count() ) - strings_displayed = [ 'Handle', 'Missing', 'tool dependencies', 'emboss', '5.0.0', 'package' ] + strings_displayed = [ 'Handle', 'Never installed', 'tool dependencies', 'emboss', '5.0.0', 'package' ] self.install_repository( 'emboss_0030', common.test_user_1_name, 'Test 0030 Repository Dependency Revisions', diff -r 753130def2f89698bb95a554ce76c7ea8c5102d7 -r 3faa833c15b5162db69f061bdbd4e951ba2ffdc7 test/tool_shed/functional/test_1220_uninstall_reinstall_repository_with_repository_dependencies.py --- a/test/tool_shed/functional/test_1220_uninstall_reinstall_repository_with_repository_dependencies.py +++ b/test/tool_shed/functional/test_1220_uninstall_reinstall_repository_with_repository_dependencies.py @@ -70,7 +70,7 @@ self.galaxy_logout() self.galaxy_login( email=common.admin_email, username=common.admin_username ) base_datatypes_count = int( self.get_datatypes_count() ) - strings_displayed = [ 'Handle', 'Missing', 'tool dependencies', 'emboss', '5.0.0', 'package' ] + strings_displayed = [ 'Handle', 'Never installed', 'tool dependencies', 'emboss', '5.0.0', 'package' ] self.install_repository( emboss_repository_name, common.test_user_1_name, 'Test 0020 Basic Repository Dependencies', diff -r 753130def2f89698bb95a554ce76c7ea8c5102d7 -r 3faa833c15b5162db69f061bdbd4e951ba2ffdc7 test/tool_shed/functional/test_1230_uninstall_reinstall_repository_with_dependency_revisions.py --- a/test/tool_shed/functional/test_1230_uninstall_reinstall_repository_with_dependency_revisions.py +++ b/test/tool_shed/functional/test_1230_uninstall_reinstall_repository_with_dependency_revisions.py @@ -107,7 +107,7 @@ self.galaxy_logout() self.galaxy_login( email=common.admin_email, username=common.admin_username ) base_datatypes_count = int( self.get_datatypes_count() ) - strings_displayed = [ 'Handle', 'Missing', 'tool dependencies', 'emboss', '5.0.0', 'package' ] + strings_displayed = [ 'Handle', 'Never installed', 'tool dependencies', 'emboss', '5.0.0', 'package' ] self.install_repository( emboss_repository_name, common.test_user_1_name, 'Test 0030 Repository Dependency Revisions', 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)
-
Bitbucket