Skip to content

Commit

Permalink
Merge branch 'release_16.07' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
natefoo committed Aug 4, 2016
2 parents 7efa1e0 + 8b0d88b commit 3206a54
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 54 deletions.
45 changes: 0 additions & 45 deletions lib/galaxy/datatypes/tracks.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,48 +83,3 @@ def display_peek( self, dataset ):

def sniff( self, filename ):
return False


class HubAssembly( Html ):
"""
derived class for BioC data structures in Galaxy
"""

file_ext = 'huba'
composite_type = 'auto_primary_file'

def __init__(self, **kwd):
Html.__init__(self, **kwd)

def generate_primary_file( self, dataset=None ):
"""
This is called only at upload to write the html file
cannot rename the datasets here - they come with the default unfortunately
"""
rval = [
'<html><head><title>Files for Composite Dataset (%s)</title></head><p/>\
This composite dataset is composed of the following files:<p/><ul>' % (
self.file_ext)]
for composite_name, composite_file in self.get_composite_files( dataset=dataset ).items():
opt_text = ''
if composite_file.optional:
opt_text = ' (optional)'
rval.append('<li><a href="%s">%s</a>%s' % ( composite_name, composite_name, opt_text) )
rval.append('</ul></html>')
return "\n".join(rval)

def set_peek( self, dataset, is_multi_byte=False ):
if not dataset.dataset.purged:
dataset.peek = "Track Hub structure: Visualization in UCSC Track Hub"
else:
dataset.peek = 'file does not exist'
dataset.blurb = 'file purged from disk'

def display_peek( self, dataset ):
try:
return dataset.peek
except:
return "Track Hub structure: Visualization in UCSC Track Hub"

def sniff( self, filename ):
return False
15 changes: 10 additions & 5 deletions lib/galaxy/jobs/runners/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,13 +207,18 @@ def build_command_line( self, job_wrapper, include_metadata=False, include_work_
container=container
)

def get_work_dir_outputs( self, job_wrapper, job_working_directory=None ):
def get_work_dir_outputs( self, job_wrapper, job_working_directory=None, tool_working_directory=None ):
"""
Returns list of pairs (source_file, destination) describing path
to work_dir output file and ultimate destination.
"""
if not job_working_directory:
job_working_directory = os.path.abspath( job_wrapper.working_directory )
if tool_working_directory is not None and job_working_directory is not None:
raise Exception("get_work_dir_outputs called with both a job and tool working directory, only one may be specified")

if tool_working_directory is None:
if not job_working_directory:
job_working_directory = os.path.abspath( job_wrapper.working_directory )
tool_working_directory = os.path.join(job_working_directory, "working")

# Set up dict of dataset id --> output path; output path can be real or
# false depending on outputs_to_working_directory
Expand All @@ -234,9 +239,9 @@ def get_work_dir_outputs( self, job_wrapper, job_working_directory=None ):
if hda_tool_output and hda_tool_output.from_work_dir:
# Copy from working dir to HDA.
# TODO: move instead of copy to save time?
source_file = os.path.join( job_working_directory, 'working', hda_tool_output.from_work_dir )
source_file = os.path.join( tool_working_directory, hda_tool_output.from_work_dir )
destination = job_wrapper.get_output_destination( output_paths[ dataset.dataset_id ] )
if in_directory( source_file, job_working_directory ):
if in_directory( source_file, tool_working_directory ):
output_pairs.append( ( source_file, destination ) )
else:
# Security violation.
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/jobs/runners/pulsar.py
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ def __build_metadata_configuration(self, client, job_wrapper, remote_metadata, r
# each work_dir output substitute the effective path on the Pulsar
# server relative to the remote working directory as the
# false_path to send the metadata command generation module.
work_dir_outputs = self.get_work_dir_outputs(job_wrapper, job_working_directory=working_directory)
work_dir_outputs = self.get_work_dir_outputs(job_wrapper, tool_working_directory=working_directory)
outputs = [Bunch(false_path=os.path.join(outputs_directory, os.path.basename(path)), real_path=path) for path in self.get_output_files(job_wrapper)]
for output in outputs:
for pulsar_workdir_path, real_path in work_dir_outputs:
Expand Down
8 changes: 5 additions & 3 deletions lib/galaxy/util/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -707,9 +707,11 @@ def __init__( self, params, sanitize=True ):
# name. Anything relying on NEVER_SANITIZE should be
# changed to not require this and NEVER_SANITIZE should be
# removed.
if key not in self.NEVER_SANITIZE and True not in [ key.endswith( "|%s" % nonsanitize_parameter ) for
nonsanitize_parameter in self.NEVER_SANITIZE ]:
self.__dict__[ key ] = sanitize_param( value )
if (value is not None and
key not in self.NEVER_SANITIZE and
True not in [ key.endswith( "|%s" % nonsanitize_parameter ) for
nonsanitize_parameter in self.NEVER_SANITIZE ]):
self.__dict__[ key ] = sanitize_param( value )
else:
self.__dict__[ key ] = value
else:
Expand Down

0 comments on commit 3206a54

Please sign in to comment.