commit/galaxy-central: greg: Fix the tool migration process that was broken due to the recent changes in the imports to various Galaxy framework files, mostly the Galaxy model.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/eea034b7cc62/ changeset: eea034b7cc62 user: greg date: 2012-11-24 16:21:48 summary: Fix the tool migration process that was broken due to the recent changes in the imports to various Galaxy framework files, mostly the Galaxy model. affected #: 4 files diff -r 1d078ed70cb8faf207c6367761a683bf6d9c3e68 -r eea034b7cc625fa294fdd1e071d99defb40f67d3 lib/galaxy/tool_shed/__init__.py --- a/lib/galaxy/tool_shed/__init__.py +++ b/lib/galaxy/tool_shed/__init__.py @@ -2,7 +2,7 @@ Classes encapsulating the management of repositories installed from Galaxy tool sheds. """ import os -import galaxy.util.shed_util +from galaxy.util.shed_util import * from galaxy.model.orm import * from galaxy import eggs @@ -27,7 +27,7 @@ ElementInclude.include( root ) tool_path = root.get( 'tool_path', None ) if tool_path: - tool_shed = galaxy.util.shed_util.clean_tool_shed_url( tool_shed_repository.tool_shed ) + tool_shed = clean_tool_shed_url( tool_shed_repository.tool_shed ) relative_path = os.path.join( tool_path, tool_shed, 'repos', @@ -44,13 +44,13 @@ .order_by( self.model.ToolShedRepository.table.c.id ): relative_install_dir = self.get_repository_install_dir( tool_shed_repository ) if relative_install_dir: - installed_repository_dict = galaxy.util.shed_util.load_installed_datatypes( self.app, tool_shed_repository, relative_install_dir ) + installed_repository_dict = load_installed_datatypes( self.app, tool_shed_repository, relative_install_dir ) if installed_repository_dict: self.installed_repository_dicts.append( installed_repository_dict ) def load_proprietary_converters_and_display_applications( self, deactivate=False ): for installed_repository_dict in self.installed_repository_dicts: if installed_repository_dict[ 'converter_path' ]: - galaxy.util.shed_util.load_installed_datatype_converters( self.app, installed_repository_dict, deactivate=deactivate ) + load_installed_datatype_converters( self.app, installed_repository_dict, deactivate=deactivate ) if installed_repository_dict[ 'display_path' ]: - galaxy.util.shed_util.load_installed_display_applications( self.app, installed_repository_dict, deactivate=deactivate ) + load_installed_display_applications( self.app, installed_repository_dict, deactivate=deactivate ) \ No newline at end of file diff -r 1d078ed70cb8faf207c6367761a683bf6d9c3e68 -r eea034b7cc625fa294fdd1e071d99defb40f67d3 lib/galaxy/tool_shed/migrate/common.py --- a/lib/galaxy/tool_shed/migrate/common.py +++ b/lib/galaxy/tool_shed/migrate/common.py @@ -2,6 +2,7 @@ import galaxy.config import galaxy.datatypes.registry from galaxy import tools +from galaxy.tools.data import * import galaxy.model.mapping import galaxy.tools.search from galaxy.objectstore import build_object_store_from_config @@ -42,8 +43,8 @@ # Load the data types in the Galaxy distribution, which are defined in self.config.datatypes_config. self.datatypes_registry.load_datatypes( self.config.root, self.config.datatypes_config ) # Initialize tool data tables using the config defined by self.config.tool_data_table_config_path. - self.tool_data_tables = galaxy.tools.data.ToolDataTableManager( tool_data_path=self.config.tool_data_path, - config_filename=self.config.tool_data_table_config_path ) + self.tool_data_tables = ToolDataTableManager( tool_data_path=self.config.tool_data_path, + config_filename=self.config.tool_data_table_config_path ) # Load additional entries defined by self.config.shed_tool_data_table_config into tool data tables. self.tool_data_tables.load_from_config_file( config_filename=self.config.shed_tool_data_table_config, tool_data_path=self.tool_data_tables.tool_data_path, diff -r 1d078ed70cb8faf207c6367761a683bf6d9c3e68 -r eea034b7cc625fa294fdd1e071d99defb40f67d3 lib/galaxy/util/shed_util.py --- a/lib/galaxy/util/shed_util.py +++ b/lib/galaxy/util/shed_util.py @@ -1,7 +1,6 @@ import os, tempfile, shutil, logging, urllib2 from galaxy import util from galaxy.datatypes.checkers import * -from galaxy.datatypes.sniff import is_column_based from galaxy.util.json import * from galaxy.util.shed_util_common import * from galaxy.tools.search import ToolBoxSearch @@ -475,13 +474,6 @@ else: tool_section = None return tool_section -def generate_workflow_metadata( relative_path, exported_workflow_dict, metadata_dict ): - """Update the received metadata_dict with changes that have been applied to the received exported_workflow_dict.""" - if 'workflows' in metadata_dict: - metadata_dict[ 'workflows' ].append( ( relative_path, exported_workflow_dict ) ) - else: - metadata_dict[ 'workflows' ] = [ ( relative_path, exported_workflow_dict ) ] - return metadata_dict def get_config( config_file, repo, ctx, dir ): """Return the latest version of config_filename from the repository manifest.""" config_file = strip_path( config_file ) @@ -817,6 +809,24 @@ parent_id=tool_version_using_parent_id.id ) sa_session.add( tool_version_association ) sa_session.flush() +def is_column_based( fname, sep='\t', skip=0, is_multi_byte=False ): + """See if the file is column based with respect to a separator.""" + headers = get_headers( fname, sep, is_multi_byte=is_multi_byte ) + count = 0 + if not headers: + return False + for hdr in headers[ skip: ]: + if hdr and hdr[ 0 ] and not hdr[ 0 ].startswith( '#' ): + if len( hdr ) > 1: + count = len( hdr ) + break + if count < 2: + return False + for hdr in headers[ skip: ]: + if hdr and hdr[ 0 ] and not hdr[ 0 ].startswith( '#' ): + if len( hdr ) != count: + return False + return True def is_data_index_sample_file( file_path ): """ Attempt to determine if a .sample file is appropriate for copying to ~/tool-data when a tool shed repository is being installed diff -r 1d078ed70cb8faf207c6367761a683bf6d9c3e68 -r eea034b7cc625fa294fdd1e071d99defb40f67d3 lib/galaxy/util/shed_util_common.py --- a/lib/galaxy/util/shed_util_common.py +++ b/lib/galaxy/util/shed_util_common.py @@ -2,6 +2,7 @@ from galaxy import util from galaxy.tools import parameters from galaxy.util import inflector +from galaxy.util.json import * from galaxy.web import url_for from galaxy.web.form_builder import SelectField from galaxy.datatypes.checkers import * @@ -724,6 +725,13 @@ else: metadata_dict[ 'tools' ] = [ tool_dict ] return metadata_dict +def generate_workflow_metadata( relative_path, exported_workflow_dict, metadata_dict ): + """Update the received metadata_dict with changes that have been applied to the received exported_workflow_dict.""" + if 'workflows' in metadata_dict: + metadata_dict[ 'workflows' ].append( ( relative_path, exported_workflow_dict ) ) + else: + metadata_dict[ 'workflows' ] = [ ( relative_path, exported_workflow_dict ) ] + return metadata_dict def get_changectx_for_changeset( repo, changeset_revision, **kwd ): """Retrieve a specified changectx from a repository""" for changeset in repo.changelog: 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