Merge branch 'release_16.04' into dev

This commit is contained in:
Dannon Baker
2016-04-20 11:54:22 -04:00
6 changed files with 17 additions and 12 deletions
@@ -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 ''
+2
View File
@@ -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
+6 -3
View File
@@ -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:
+1 -1
View File
@@ -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):
+3 -3
View File
@@ -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 ) ) ) )
+3 -3
View File
@@ -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.
-->
<tool name="BioMart" id="biomart" tool_type="data_source" version="1.0.1">
<description>Central server</description>
<description>Ensembl server</description>
<command interpreter="python">data_source.py $output $__app__.config.output_size_limit</command>
<inputs action="http://www.biomart.org/biomart/martview" check_values="false" method="get" target="_top">
<display>go to BioMart Central $GALAXY_URL</display>
<inputs action="http://www.ensembl.org/biomart/martview" check_values="false" method="get" target="_top">
<display>go to BioMart Ensembl $GALAXY_URL</display>
<param name="GALAXY_URL" type="baseurl" value="/tool_runner/biomart" />
</inputs>
<request_param_translation>