1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/029cc5c14f1a/ Changeset: 029cc5c14f1a User: greg Date: 2013-12-17 16:08:03 Summary: Handle strangely defined tool tests when setting metadata in tool shed repositories. Affected #: 2 files diff -r 97c69fcfeaac1756a7ad5d92c8ade74b2d611561 -r 029cc5c14f1a8fb81e4bbdc3872757b297e1efa0 lib/tool_shed/util/metadata_util.py --- a/lib/tool_shed/util/metadata_util.py +++ b/lib/tool_shed/util/metadata_util.py @@ -927,10 +927,13 @@ guid = suc.generate_tool_guid( repository_clone_url, tool ) # Handle tool.requirements. tool_requirements = [] - for tr in tool.requirements: - requirement_dict = dict( name=tr.name, - type=tr.type, - version=tr.version ) + for tool_requirement in tool.requirements: + name = str( tool_requirement.name ) + type = str( tool_requirement.type ) + version = str( tool_requirement.version ) if tool_requirement.version else None + requirement_dict = dict( name=name, + type=type, + version=version ) tool_requirements.append( requirement_dict ) # Handle tool.tests. tool_tests = [] @@ -941,18 +944,31 @@ value, extra = required_file required_files.append( ( value ) ) inputs = [] - for input_field, values in ttb.inputs.iteritems(): - if len( values ) == 1: - inputs.append( ( input_field, values[0] ) ) - else: - inputs.append( ( input_field, values ) ) + for param_name, values in ttb.inputs.iteritems(): + # Handle improperly defined or strange test parameters and values. + if param_name is not None: + if values is None: + # An example is the 3rd test in http://testtoolshed.g2.bx.psu.edu/view/devteam/samtools_rmdup + # which is defined as: + # <test> + # <param name="input1" value="1.bam" ftype="bam" /> + # <param name="bam_paired_end_type_selector" value="PE" /> + # <param name="force_se" /> + # <output name="output1" file="1.bam" ftype="bam" sort="True" /> + # </test> + inputs.append( ( param_name, values ) ) + else: + if len( values ) == 1: + inputs.append( ( param_name, values[ 0 ] ) ) + else: + inputs.append( ( param_name, values ) ) outputs = [] for output in ttb.outputs: name, file_name, extra = output outputs.append( ( name, suc.strip_path( file_name ) if file_name else None ) ) if file_name not in required_files and file_name is not None: required_files.append( file_name ) - test_dict = dict( name=ttb.name, + test_dict = dict( name=str( ttb.name ), required_files=required_files, inputs=inputs, outputs=outputs ) diff -r 97c69fcfeaac1756a7ad5d92c8ade74b2d611561 -r 029cc5c14f1a8fb81e4bbdc3872757b297e1efa0 lib/tool_shed/util/shed_util_common.py --- a/lib/tool_shed/util/shed_util_common.py +++ b/lib/tool_shed/util/shed_util_common.py @@ -254,11 +254,8 @@ else: deleted = False uninstalled = False - tool_shed_repository = get_tool_shed_repository_by_shed_name_owner_installed_changeset_revision( app, - tool_shed, - name, - owner, - installed_changeset_revision ) + tool_shed_repository = \ + get_tool_shed_repository_by_shed_name_owner_installed_changeset_revision( app, tool_shed, name, owner, installed_changeset_revision ) if tool_shed_repository: log.debug( "Updating an existing row for repository '%s' in the tool_shed_repository table, status set to '%s'." % ( str( name ), str( status ) ) ) tool_shed_repository.description = description @@ -271,19 +268,20 @@ tool_shed_repository.status = status else: log.debug( "Adding new row for repository '%s' in the tool_shed_repository table, status set to '%s'." % ( str( name ), str( status ) ) ) - tool_shed_repository = app.install_model.ToolShedRepository( tool_shed=tool_shed, - name=name, - description=description, - owner=owner, - installed_changeset_revision=installed_changeset_revision, - changeset_revision=current_changeset_revision, - ctx_rev=ctx_rev, - metadata=metadata_dict, - includes_datatypes=includes_datatypes, - dist_to_shed=dist_to_shed, - deleted=deleted, - uninstalled=uninstalled, - status=status ) + tool_shed_repository = \ + app.install_model.ToolShedRepository( tool_shed=tool_shed, + name=name, + description=description, + owner=owner, + installed_changeset_revision=installed_changeset_revision, + changeset_revision=current_changeset_revision, + ctx_rev=ctx_rev, + metadata=metadata_dict, + includes_datatypes=includes_datatypes, + dist_to_shed=dist_to_shed, + deleted=deleted, + uninstalled=uninstalled, + status=status ) context.add( tool_shed_repository ) context.flush() return tool_shed_repository 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.