diff --git a/lib/galaxy/jobs/runners/util/job_script/__init__.py b/lib/galaxy/jobs/runners/util/job_script/__init__.py index 9f144dc51a4..a08857c2462 100644 --- a/lib/galaxy/jobs/runners/util/job_script/__init__.py +++ b/lib/galaxy/jobs/runners/util/job_script/__init__.py @@ -65,7 +65,7 @@ def job_script(template=DEFAULT_JOB_FILE_TEMPLATE, **kwds): >>> script.startswith('#!/bin/sh\\n#PBS -test\\n') False >>> script = job_script(working_directory='wd', command='uptime', exit_code_path='ec', headers='#PBS -test') - >>> script.startswith('#!/bin/sh\\n#PBS -test\\n') + >>> script.startswith('#!/bin/bash\\n\\n#PBS -test\\n') True >>> script = job_script(working_directory='wd', command='uptime', exit_code_path='ec', slots_statement='GALAXY_SLOTS="$SLURM_JOB_NUM_NODES"') >>> script.find('GALAXY_SLOTS="$SLURM_JOB_NUM_NODES"\\nexport GALAXY_SLOTS\\n') > 0 @@ -76,7 +76,7 @@ def job_script(template=DEFAULT_JOB_FILE_TEMPLATE, **kwds): job_instrumenter = kwds.get("job_instrumenter", None) if job_instrumenter: del kwds["job_instrumenter"] - working_directory = kwds["working_directory"] + working_directory = kwds.get("metadata_directory", kwds["working_directory"]) kwds["instrument_pre_commands"] = job_instrumenter.pre_execute_commands(working_directory) or '' kwds["instrument_post_commands"] = job_instrumenter.post_execute_commands(working_directory) or '' diff --git a/lib/galaxy/tools/__init__.py b/lib/galaxy/tools/__init__.py index 0fca24488a6..7a90f701fcb 100755 --- a/lib/galaxy/tools/__init__.py +++ b/lib/galaxy/tools/__init__.py @@ -1099,6 +1099,8 @@ class Tool( object, Dictifiable ): for expanded_incoming in expanded_incomings: params = {} errors = {} + if self.input_translator: + self.input_translator.translate( expanded_incoming ) if not self.check_values: # If `self.check_values` is false we don't do any checking or # processing on input This is used to pass raw values diff --git a/lib/galaxy/tools/parameters/basic.py b/lib/galaxy/tools/parameters/basic.py index 56f9a6d9893..c2883bf2cba 100644 --- a/lib/galaxy/tools/parameters/basic.py +++ b/lib/galaxy/tools/parameters/basic.py @@ -1673,13 +1673,16 @@ class BaseDataToolParameter( ToolParameter ): def to_json( self, value, app ): def single_to_json( value ): src = None - if isinstance( value, galaxy.model.DatasetCollectionElement ): + if isinstance( value, dict ) and 'src' in value and 'id' in value: + return value + elif isinstance( value, galaxy.model.DatasetCollectionElement ): src = 'dce' elif isinstance( value, app.model.HistoryDatasetCollectionAssociation ): src = 'hdca' - else: + elif hasattr( value, 'id' ): src = 'hda' - return { 'id' : app.security.encode_id( value.id ), 'src' : src } + if src is not None: + return { 'id' : app.security.encode_id( value.id ), 'src' : src } if value not in [ None, '', 'None' ]: if isinstance( value, list ) and len( value ) > 0: diff --git a/lib/galaxy/util/sanitize_html.py b/lib/galaxy/util/sanitize_html.py index 2aabbe2dccd..aec55f9f53a 100644 --- a/lib/galaxy/util/sanitize_html.py +++ b/lib/galaxy/util/sanitize_html.py @@ -194,7 +194,7 @@ class _BaseHTMLProcessor(sgmllib.SGMLParser): def output(self): '''Return processed HTML as a single string''' - return ''.join([str(p) for p in self.pieces]) + return ''.join(self.pieces) class _HTMLSanitizer(_BaseHTMLProcessor): diff --git a/lib/galaxy/util/validation.py b/lib/galaxy/util/validation.py index 7b0686cec19..a163abf0b44 100644 --- a/lib/galaxy/util/validation.py +++ b/lib/galaxy/util/validation.py @@ -5,20 +5,20 @@ TODO: Refactor BaseController references to similar methods to use this module. from galaxy import exceptions from galaxy.util.sanitize_html import sanitize_html -from six import string_types, text_type +from six import string_types def validate_and_sanitize_basestring( key, val ): if not isinstance( val, string_types ): raise exceptions.RequestParameterInvalidException( '%s must be a string or unicode: %s' % ( key, str( type( val ) ) ) ) - return text_type( sanitize_html( val, 'utf-8', 'text/html' ), 'utf-8' ) + return sanitize_html( val, 'utf-8', 'text/html' ) def validate_and_sanitize_basestring_list( key, val ): try: assert isinstance( val, list ) - return [ text_type( sanitize_html( t, 'utf-8', 'text/html' ), 'utf-8' ) for t in val ] + return [ sanitize_html( t, 'utf-8', 'text/html' ) for t in val ] except ( AssertionError, TypeError ): raise exceptions.RequestParameterInvalidException( '%s must be a list of strings: %s' % ( key, str( type( val ) ) ) ) diff --git a/tools/data_source/biomart.xml b/tools/data_source/biomart.xml index db56c299f1d..bf4c4c13bd1 100644 --- a/tools/data_source/biomart.xml +++ b/tools/data_source/biomart.xml @@ -8,10 +8,10 @@ everything including and beyond the first '&' is truncated from URL. They said they'll let us know when this is fixed at their end. --> - Central server + Ensembl server data_source.py $output $__app__.config.output_size_limit - - go to BioMart Central $GALAXY_URL + + go to BioMart Ensembl $GALAXY_URL