1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/09e86deab793/ Changeset: 09e86deab793 User: greg Date: 2014-07-22 17:33:35 Summary: Add a ToolVersionManager to manage tool versions in the Tool Shed and Galaxy installs. Affected #: 10 files diff -r 246ad6f8e6c43753a8d04ffda2f5f5f019e86fc9 -r 09e86deab7932a72af7717bef9ec67ea70d694c9 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 @@ -32,6 +32,8 @@ from tool_shed.galaxy_install.repository_dependencies import repository_dependency_manager from tool_shed.galaxy_install.tools import tool_panel_manager +from tool_shed.tools import tool_version_manager + log = logging.getLogger( __name__ ) @@ -1799,7 +1801,8 @@ text = common_util.tool_shed_get( trans.app, tool_shed_url, url ) if text: tool_version_dicts = json.from_json_string( text ) - tool_util.handle_tool_versions( trans.app, tool_version_dicts, repository ) + tvm = tool_version_manager.ToolVersionManager( trans.app ) + tvm.handle_tool_versions( tool_version_dicts, repository ) message = "Tool versions have been set for all included tools." status = 'done' else: @@ -1932,7 +1935,8 @@ if repository.includes_data_managers: data_manager_util.remove_from_data_manager( trans.app, repository ) # Update the repository metadata. - irmm = InstalledRepositoryMetadataManager( trans.app ) + tpm = tool_panel_manager.ToolPanelManager( trans.app ) + irmm = InstalledRepositoryMetadataManager( trans.app, tpm ) metadata_dict, invalid_file_tups = \ irmm.generate_metadata_for_changeset_revision( repository=repository, changeset_revision=latest_changeset_revision, @@ -1944,7 +1948,6 @@ updating_installed_repository=True, persist=True ) if 'tools' in metadata_dict: - tpm = tool_panel_manager.ToolPanelManager( trans.app ) tool_panel_dict = metadata_dict.get( 'tool_panel_section', None ) if tool_panel_dict is None: tool_panel_dict = tpm.generate_tool_panel_dict_from_shed_tool_conf_entries( repository ) @@ -2123,7 +2126,8 @@ tool_config = os.path.join( shed_config_dict.get( 'tool_path' ), tool_config ) tool = trans.app.toolbox.load_tool( os.path.abspath( tool_config ), guid=tool_metadata[ 'guid' ] ) if tool: - tool_version = tool_util.get_tool_version( trans.app, str( tool.id ) ) + tvm = tool_version_manager.ToolVersionManager( trans.app ) + tool_version = tvm.get_tool_version( str( tool.id ) ) tool_lineage = tool_version.get_version_ids( trans.app, reverse=True ) break return trans.fill_template( "/admin/tool_shed_repository/view_tool_metadata.mako", diff -r 246ad6f8e6c43753a8d04ffda2f5f5f019e86fc9 -r 09e86deab7932a72af7717bef9ec67ea70d694c9 lib/galaxy/webapps/tool_shed/controllers/repository.py --- a/lib/galaxy/webapps/tool_shed/controllers/repository.py +++ b/lib/galaxy/webapps/tool_shed/controllers/repository.py @@ -20,7 +20,9 @@ from tool_shed.galaxy_install import dependency_display from tool_shed.metadata import repository_metadata_manager + from tool_shed.tools import tool_validator +from tool_shed.tools import tool_version_manager from tool_shed.util import basic_util from tool_shed.util import common_util @@ -3432,10 +3434,10 @@ basic_util.remove_dir( work_dir ) break if guid: - tool_lineage = tool_util.get_version_lineage_for_tool( trans.app, - repository_id, - repository_metadata, - guid ) + tvm = tool_version_manager.ToolVersionManager( trans.app ) + tool_lineage = tvm.get_version_lineage_for_tool( repository_id, + repository_metadata, + guid ) else: repository_metadata_id = None metadata = None diff -r 246ad6f8e6c43753a8d04ffda2f5f5f019e86fc9 -r 09e86deab7932a72af7717bef9ec67ea70d694c9 lib/tool_shed/galaxy_install/dependency_display.py --- a/lib/tool_shed/galaxy_install/dependency_display.py +++ b/lib/tool_shed/galaxy_install/dependency_display.py @@ -1,3 +1,4 @@ +import json import logging import os import threading @@ -461,7 +462,7 @@ url = common_util.url_join( tool_shed_url, 'repository/get_readme_files%s' % params ) raw_text = common_util.tool_shed_get( self.app, tool_shed_url, url ) - readme_files_dict = json.from_json_string( raw_text ) + readme_files_dict = json.loads( raw_text ) else: readme_files_dict = readme_util.build_readme_files_dict( self.app, repository, diff -r 246ad6f8e6c43753a8d04ffda2f5f5f019e86fc9 -r 09e86deab7932a72af7717bef9ec67ea70d694c9 lib/tool_shed/galaxy_install/install_manager.py --- a/lib/tool_shed/galaxy_install/install_manager.py +++ b/lib/tool_shed/galaxy_install/install_manager.py @@ -35,6 +35,8 @@ from tool_shed.galaxy_install.tool_dependencies.recipe.recipe_manager import TagManager from tool_shed.galaxy_install.tools import tool_panel_manager +from tool_shed.tools import tool_version_manager + log = logging.getLogger( __name__ ) @@ -438,10 +440,13 @@ class InstallRepositoryManager( object ): - def __init__( self, app ): + def __init__( self, app, tpm=None ): self.app = app self.install_model = self.app.install_model - self.tpm = tool_panel_manager.ToolPanelManager( self.app ) + if tpm is None: + self.tpm = tool_panel_manager.ToolPanelManager( self.app ) + else: + self.tpm = tpm def get_repository_components_for_installation( self, encoded_tsr_id, encoded_tsr_ids, repo_info_dicts, tool_panel_section_keys ): @@ -503,7 +508,7 @@ reinstalling an uninstalled repository. """ shed_config_dict = self.app.toolbox.get_shed_config_dict_by_filename( shed_tool_conf ) - irmm = InstalledRepositoryMetadataManager( self.app ) + irmm = InstalledRepositoryMetadataManager( self.app, self.tpm ) metadata_dict, invalid_file_tups = \ irmm.generate_metadata_for_changeset_revision( repository=tool_shed_repository, changeset_revision=tool_shed_repository.changeset_revision, @@ -869,7 +874,8 @@ text = common_util.tool_shed_get( self.app, tool_shed_url, url ) if text: tool_version_dicts = json.loads( text ) - tool_util.handle_tool_versions( self.app, tool_version_dicts, tool_shed_repository ) + tvm = tool_version_manager.ToolVersionManager( self.app ) + tvm.handle_tool_versions( tool_version_dicts, tool_shed_repository ) else: if not error_message: error_message = "" diff -r 246ad6f8e6c43753a8d04ffda2f5f5f019e86fc9 -r 09e86deab7932a72af7717bef9ec67ea70d694c9 lib/tool_shed/galaxy_install/installed_repository_manager.py --- a/lib/tool_shed/galaxy_install/installed_repository_manager.py +++ b/lib/tool_shed/galaxy_install/installed_repository_manager.py @@ -81,8 +81,8 @@ repository.deleted = False repository.status = self.install_model.ToolShedRepository.installation_status.INSTALLED if repository.includes_tools_for_display_in_tool_panel: - irmm = InstalledRepositoryMetadataManager( self.app ) tpm = tool_panel_manager.ToolPanelManager( self.app ) + irmm = InstalledRepositoryMetadataManager( self.app, tpm ) metadata = repository.metadata repository_tools_tups = irmm.get_repository_tools_tups( metadata ) # Reload tools into the appropriate tool panel section. diff -r 246ad6f8e6c43753a8d04ffda2f5f5f019e86fc9 -r 09e86deab7932a72af7717bef9ec67ea70d694c9 lib/tool_shed/galaxy_install/metadata/installed_repository_metadata_manager.py --- a/lib/tool_shed/galaxy_install/metadata/installed_repository_metadata_manager.py +++ b/lib/tool_shed/galaxy_install/metadata/installed_repository_metadata_manager.py @@ -19,10 +19,13 @@ class InstalledRepositoryMetadataManager( metadata_generator.MetadataGenerator ): - def __init__( self, app ): + def __init__( self, app, tpm=None ): super( InstalledRepositoryMetadataManager, self ).__init__( app ) self.app = app - self.tpm = tool_panel_manager.ToolPanelManager( self.app ) + if tpm is None: + self.tpm = tool_panel_manager.ToolPanelManager( self.app ) + else: + self.tpm = tpm def build_repository_ids_select_field( self, name='repository_ids', multiple=True, display='checkboxes' ): """Generate the current list of repositories for resetting metadata.""" diff -r 246ad6f8e6c43753a8d04ffda2f5f5f019e86fc9 -r 09e86deab7932a72af7717bef9ec67ea70d694c9 lib/tool_shed/galaxy_install/repair_repository_manager.py --- a/lib/tool_shed/galaxy_install/repair_repository_manager.py +++ b/lib/tool_shed/galaxy_install/repair_repository_manager.py @@ -150,6 +150,7 @@ metadata = repository.metadata repair_dict = {} + tpm = tool_panel_manager.ToolPanelManager( self.app ) if repository.status in [ self.app.install_model.ToolShedRepository.installation_status.DEACTIVATED ]: try: self.app.installed_repository_manager.activate_repository( repository ) @@ -162,7 +163,6 @@ suc.get_tool_panel_config_tool_path_install_dir( self.app, repository ) # Reset the repository attributes to the New state for installation. if metadata: - tpm = tool_panel_manager.ToolPanelManager( self.app ) tool_section, tool_panel_section_key = \ tpm.handle_tool_panel_selection( self.app.toolbox, metadata, @@ -179,7 +179,7 @@ deleted=False, uninstalled=False, remove_from_disk=True ) - irm = install_manager.InstallRepositoryManager( self.app ) + irm = install_manager.InstallRepositoryManager( self.app, tpm ) irm.install_tool_shed_repository( repository, repo_info_dict, tool_panel_section_key, @@ -190,7 +190,7 @@ if repository.status in [ self.app.install_model.ToolShedRepository.installation_status.ERROR ]: repair_dict = add_repair_dict_entry( repository.name, repository.error_message ) else: - irm = install_manager.InstallRepositoryManager( self.app ) + irm = install_manager.InstallRepositoryManager( self.app, tpm ) # We have an installed tool shed repository, so handle tool dependencies if necessary. if repository.missing_tool_dependencies and metadata and 'tool_dependencies' in metadata: work_dir = tempfile.mkdtemp( prefix="tmp-toolshed-itdep" ) diff -r 246ad6f8e6c43753a8d04ffda2f5f5f019e86fc9 -r 09e86deab7932a72af7717bef9ec67ea70d694c9 lib/tool_shed/galaxy_install/tool_migration_manager.py --- a/lib/tool_shed/galaxy_install/tool_migration_manager.py +++ b/lib/tool_shed/galaxy_install/tool_migration_manager.py @@ -11,11 +11,14 @@ from galaxy import util from galaxy.tools import ToolSection +from galaxy.util.odict import odict from tool_shed.galaxy_install import install_manager from tool_shed.galaxy_install.metadata.installed_repository_metadata_manager import InstalledRepositoryMetadataManager from tool_shed.galaxy_install.tools import tool_panel_manager +from tool_shed.tools import tool_version_manager + from tool_shed.util import basic_util from tool_shed.util import common_util from tool_shed.util import datatype_util @@ -24,7 +27,6 @@ from tool_shed.util import tool_dependency_util from tool_shed.util import tool_util from tool_shed.util import xml_util -from galaxy.util.odict import odict log = logging.getLogger( __name__ ) @@ -41,6 +43,7 @@ self.app = app self.toolbox = self.app.toolbox self.migrated_tools_config = migrated_tools_config + # Initialize the ToolPanelManager. self.tpm = tool_panel_manager.ToolPanelManager( self.app ) # If install_dependencies is True but tool_dependency_dir is not set, do not attempt # to install but print informative error message. @@ -412,7 +415,7 @@ log.exception( "Exception attempting to filter and persist non-shed-related tool panel configs:\n%s" % str( e ) ) finally: lock.release() - irmm = InstalledRepositoryMetadataManager( self.app ) + irmm = InstalledRepositoryMetadataManager( self.app, self.tpm ) metadata_dict, invalid_file_tups = \ irmm.generate_metadata_for_changeset_revision( repository=tool_shed_repository, changeset_revision=tool_shed_repository.changeset_revision, @@ -471,7 +474,7 @@ new_install=True ) if install_dependencies and tool_dependencies and has_tool_dependencies: # Install tool dependencies. - irm = install_manager.InstallRepositoryManager( self.app ) + irm = install_manager.InstallRepositoryManager( self.app, self.tpm ) itdm = install_manager.InstallToolDependencyManager( self.app ) irm.update_tool_shed_repository_status( tool_shed_repository, self.app.install_model.ToolShedRepository.installation_status.INSTALLING_TOOL_DEPENDENCIES ) @@ -533,7 +536,7 @@ if cloned_ok and is_installed: print "Skipping automatic install of repository '", tool_shed_repository.name, "' because it has already been installed in location ", clone_dir else: - irm = install_manager.InstallRepositoryManager( self.app ) + irm = install_manager.InstallRepositoryManager( self.app, self.tpm ) repository_clone_url = os.path.join( self.tool_shed_url, 'repos', tool_shed_repository.owner, tool_shed_repository.name ) relative_install_dir = os.path.join( relative_clone_dir, tool_shed_repository.name ) install_dir = os.path.join( clone_dir, tool_shed_repository.name ) @@ -556,6 +559,8 @@ self.app.install_model.context.refresh( tool_shed_repository ) metadata_dict = tool_shed_repository.metadata if 'tools' in metadata_dict: + # Initialize the ToolVersionManager. + tvm = tool_version_manager.ToolVersionManager( self.app ) irm.update_tool_shed_repository_status( tool_shed_repository, self.app.install_model.ToolShedRepository.installation_status.SETTING_TOOL_VERSIONS ) # Get the tool_versions from the tool shed for each tool in the installed change set. @@ -564,7 +569,7 @@ text = common_util.tool_shed_get( self.app, self.tool_shed_url, url ) if text: tool_version_dicts = json.loads( text ) - tool_util.handle_tool_versions( self.app, tool_version_dicts, tool_shed_repository ) + tvm.handle_tool_versions( tool_version_dicts, tool_shed_repository ) else: # Set the tool versions since they seem to be missing for this repository in the tool shed. # CRITICAL NOTE: These default settings may not properly handle all parent/child associations. @@ -573,8 +578,8 @@ tool_id = tool_dict[ 'guid' ] old_tool_id = tool_dict[ 'id' ] tool_version = tool_dict[ 'version' ] - tool_version_using_old_id = tool_util.get_tool_version( self.app, old_tool_id ) - tool_version_using_guid = tool_util.get_tool_version( self.app, tool_id ) + tool_version_using_old_id = tvm.get_tool_version( old_tool_id ) + tool_version_using_guid = tvm.get_tool_version( tool_id ) if not tool_version_using_old_id: tool_version_using_old_id = self.app.install_model.ToolVersion( tool_id=old_tool_id, tool_shed_repository=tool_shed_repository ) @@ -586,12 +591,12 @@ self.app.install_model.context.add( tool_version_using_guid ) self.app.install_model.context.flush() # Associate the two versions as parent / child. - tool_version_association = tool_util.get_tool_version_association( self.app, - tool_version_using_old_id, - tool_version_using_guid ) + tool_version_association = tvm.get_tool_version_association( tool_version_using_old_id, + tool_version_using_guid ) if not tool_version_association: - tool_version_association = self.app.install_model.ToolVersionAssociation( tool_id=tool_version_using_guid.id, - parent_id=tool_version_using_old_id.id ) + tool_version_association = \ + self.app.install_model.ToolVersionAssociation( tool_id=tool_version_using_guid.id, + parent_id=tool_version_using_old_id.id ) self.app.install_model.context.add( tool_version_association ) self.app.install_model.context.flush() irm.update_tool_shed_repository_status( tool_shed_repository, diff -r 246ad6f8e6c43753a8d04ffda2f5f5f019e86fc9 -r 09e86deab7932a72af7717bef9ec67ea70d694c9 lib/tool_shed/tools/tool_version_manager.py --- /dev/null +++ b/lib/tool_shed/tools/tool_version_manager.py @@ -0,0 +1,103 @@ +import logging +import os + +from galaxy.model.orm import and_ + +from tool_shed.util import hg_util +from tool_shed.util import shed_util_common as suc + +log = logging.getLogger( __name__ ) + + +class ToolVersionManager( object ): + + def __init__( self, app ): + self.app = app + + def get_tool_version( self, tool_id ): + context = self.app.install_model.context + return context.query( self.app.install_model.ToolVersion ) \ + .filter( self.app.install_model.ToolVersion.table.c.tool_id == tool_id ) \ + .first() + + def get_tool_version_association( self, parent_tool_version, tool_version ): + """ + Return a ToolVersionAssociation if one exists that associates the two received + tool_versions This function is called only from Galaxy. + """ + context = self.app.install_model.context + return context.query( self.app.install_model.ToolVersionAssociation ) \ + .filter( and_( self.app.install_model.ToolVersionAssociation.table.c.parent_id == parent_tool_version.id, + self.app.install_model.ToolVersionAssociation.table.c.tool_id == tool_version.id ) ) \ + .first() + + def get_version_lineage_for_tool( self, repository_id, repository_metadata, guid ): + """ + Return the tool version lineage chain in descendant order for the received + guid contained in the received repsitory_metadata.tool_versions. This function + is called only from the Tool Shed. + """ + repository = suc.get_repository_by_id( self.app, repository_id ) + repo = hg_util.get_repo_for_repository( self.app, repository=repository, repo_path=None, create=False ) + # Initialize the tool lineage + version_lineage = [ guid ] + # Get all ancestor guids of the received guid. + current_child_guid = guid + for changeset in hg_util.reversed_upper_bounded_changelog( repo, repository_metadata.changeset_revision ): + ctx = repo.changectx( changeset ) + rm = suc.get_repository_metadata_by_changeset_revision( self.app, repository_id, str( ctx ) ) + if rm: + parent_guid = rm.tool_versions.get( current_child_guid, None ) + if parent_guid: + version_lineage.append( parent_guid ) + current_child_guid = parent_guid + # Get all descendant guids of the received guid. + current_parent_guid = guid + for changeset in hg_util.reversed_lower_upper_bounded_changelog( repo, + repository_metadata.changeset_revision, + repository.tip( self.app ) ): + ctx = repo.changectx( changeset ) + rm = suc.get_repository_metadata_by_changeset_revision( self.app, repository_id, str( ctx ) ) + if rm: + tool_versions = rm.tool_versions + for child_guid, parent_guid in tool_versions.items(): + if parent_guid == current_parent_guid: + version_lineage.insert( 0, child_guid ) + current_parent_guid = child_guid + break + return version_lineage + + def handle_tool_versions( self, tool_version_dicts, tool_shed_repository ): + """ + Using the list of tool_version_dicts retrieved from the Tool Shed (one per changeset + revision up to the currently installed changeset revision), create the parent / child + pairs of tool versions. Each dictionary contains { tool id : parent tool id } pairs. + This function is called only from Galaxy. + """ + context = self.app.install_model.context + for tool_version_dict in tool_version_dicts: + for tool_guid, parent_id in tool_version_dict.items(): + tool_version_using_tool_guid = self.get_tool_version( tool_guid ) + tool_version_using_parent_id = self.get_tool_version( parent_id ) + if not tool_version_using_tool_guid: + tool_version_using_tool_guid = \ + self.app.install_model.ToolVersion( tool_id=tool_guid, + tool_shed_repository=tool_shed_repository ) + context.add( tool_version_using_tool_guid ) + context.flush() + if not tool_version_using_parent_id: + tool_version_using_parent_id = \ + self.app.install_model.ToolVersion( tool_id=parent_id, + tool_shed_repository=tool_shed_repository ) + context.add( tool_version_using_parent_id ) + context.flush() + tool_version_association = \ + self.get_tool_version_association( tool_version_using_parent_id, + tool_version_using_tool_guid ) + if not tool_version_association: + # Associate the two versions as parent / child. + tool_version_association = \ + self.app.install_model.ToolVersionAssociation( tool_id=tool_version_using_tool_guid.id, + parent_id=tool_version_using_parent_id.id ) + context.add( tool_version_association ) + context.flush() diff -r 246ad6f8e6c43753a8d04ffda2f5f5f019e86fc9 -r 09e86deab7932a72af7717bef9ec67ea70d694c9 lib/tool_shed/util/tool_util.py --- a/lib/tool_shed/util/tool_util.py +++ b/lib/tool_shed/util/tool_util.py @@ -1,21 +1,19 @@ import logging import os import shutil + import galaxy.tools from galaxy import util from galaxy.datatypes import checkers -from galaxy.model.orm import and_ from galaxy.tools import parameters -from galaxy.tools.search import ToolBoxSearch from galaxy.util.expressions import ExpressionContext from galaxy.web.form_builder import SelectField from galaxy.tools.actions.upload import UploadToolAction + from tool_shed.util import basic_util -from tool_shed.util import common_util from tool_shed.util import hg_util from tool_shed.util import xml_util import tool_shed.util.shed_util_common as suc -from xml.etree import ElementTree as XmlET log = logging.getLogger( __name__ ) @@ -167,55 +165,6 @@ tool_index_sample_files.append( str( s ) ) return tool_index_sample_files -def get_tool_version( app, tool_id ): - context = app.install_model.context - return context.query( app.install_model.ToolVersion ) \ - .filter( app.install_model.ToolVersion.table.c.tool_id == tool_id ) \ - .first() - -def get_tool_version_association( app, parent_tool_version, tool_version ): - """Return a ToolVersionAssociation if one exists that associates the two received tool_versions""" - context = app.install_model.context - return context.query( app.install_model.ToolVersionAssociation ) \ - .filter( and_( app.install_model.ToolVersionAssociation.table.c.parent_id == parent_tool_version.id, - app.install_model.ToolVersionAssociation.table.c.tool_id == tool_version.id ) ) \ - .first() - -def get_version_lineage_for_tool( app, repository_id, repository_metadata, guid ): - """ - Return the tool version lineage chain in descendant order for the received - guid contained in the received repsitory_metadata.tool_versions. - """ - repository = suc.get_repository_by_id( app, repository_id ) - repo = hg_util.get_repo_for_repository( app, repository=repository, repo_path=None, create=False ) - # Initialize the tool lineage - version_lineage = [ guid ] - # Get all ancestor guids of the received guid. - current_child_guid = guid - for changeset in hg_util.reversed_upper_bounded_changelog( repo, repository_metadata.changeset_revision ): - ctx = repo.changectx( changeset ) - rm = suc.get_repository_metadata_by_changeset_revision( app, repository_id, str( ctx ) ) - if rm: - parent_guid = rm.tool_versions.get( current_child_guid, None ) - if parent_guid: - version_lineage.append( parent_guid ) - current_child_guid = parent_guid - # Get all descendant guids of the received guid. - current_parent_guid = guid - for changeset in hg_util.reversed_lower_upper_bounded_changelog( repo, - repository_metadata.changeset_revision, - repository.tip( app ) ): - ctx = repo.changectx( changeset ) - rm = suc.get_repository_metadata_by_changeset_revision( app, repository_id, str( ctx ) ) - if rm: - tool_versions = rm.tool_versions - for child_guid, parent_guid in tool_versions.items(): - if parent_guid == current_parent_guid: - version_lineage.insert( 0, child_guid ) - current_parent_guid = child_guid - break - return version_lineage - def handle_missing_data_table_entry( app, relative_install_dir, tool_path, repository_tools_tups ): """ Inspect each tool to see if any have input parameters that are dynamically @@ -295,35 +244,6 @@ error = True return error, message -def handle_tool_versions( app, tool_version_dicts, tool_shed_repository ): - """ - Using the list of tool_version_dicts retrieved from the tool shed (one per changeset - revison up to the currently installed changeset revision), create the parent / child - pairs of tool versions. Each dictionary contains { tool id : parent tool id } pairs. - """ - context = app.install_model.context - for tool_version_dict in tool_version_dicts: - for tool_guid, parent_id in tool_version_dict.items(): - tool_version_using_tool_guid = get_tool_version( app, tool_guid ) - tool_version_using_parent_id = get_tool_version( app, parent_id ) - if not tool_version_using_tool_guid: - tool_version_using_tool_guid = app.install_model.ToolVersion( tool_id=tool_guid, tool_shed_repository=tool_shed_repository ) - context.add( tool_version_using_tool_guid ) - context.flush() - if not tool_version_using_parent_id: - tool_version_using_parent_id = app.install_model.ToolVersion( tool_id=parent_id, tool_shed_repository=tool_shed_repository ) - context.add( tool_version_using_parent_id ) - context.flush() - tool_version_association = get_tool_version_association( app, - tool_version_using_parent_id, - tool_version_using_tool_guid ) - if not tool_version_association: - # Associate the two versions as parent / child. - tool_version_association = app.install_model.ToolVersionAssociation( tool_id=tool_version_using_tool_guid.id, - parent_id=tool_version_using_parent_id.id ) - context.add( tool_version_association ) - context.flush() - def install_tool_data_tables( app, tool_shed_repository, tool_index_sample_files ): """Only ever called from Galaxy end when installing""" TOOL_DATA_TABLE_FILE_NAME = 'tool_data_table_conf.xml' 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.