Skip to content

Commit

Permalink
Merge branch 'dev' of git://github.com/galaxyproject/galaxy into run_…
Browse files Browse the repository at this point in the history
…workflow_form_004
  • Loading branch information
guerler committed Dec 7, 2015
2 parents a951d34 + 371125b commit 8c6d530
Show file tree
Hide file tree
Showing 16 changed files with 285 additions and 104 deletions.
2 changes: 1 addition & 1 deletion client/galaxy/scripts/mvc/tool/tool-form-base.js
Expand Up @@ -82,7 +82,7 @@ define(['utils/utils', 'utils/deferred', 'mvc/ui/ui-misc', 'mvc/form/form-view',
self._buildForm(new_model['tool_model'] || new_model);
!hide_message && self.message.update({
status : 'success',
message : 'Now you are using \'' + self.options.name + '\' version ' + self.options.version + '.',
message : 'Now you are using \'' + self.options.name + '\' version ' + self.options.version + ', id \'' + self.options.id + '\'.',
persistent : false
});
Galaxy.emit.debug('tool-form-base::initialize()', 'Initial tool model ready.', new_model);
Expand Down
3 changes: 2 additions & 1 deletion lib/galaxy/managers/histories.py
Expand Up @@ -294,7 +294,8 @@ def serialize_history_state( self, history, key, **context ):
hda_state_counts[states.UPLOAD] > 0):
state = states.RUNNING
# TODO: this method may be more useful if we *also* polled the histories jobs here too
elif hda_state_counts[ states.QUEUED ] > 0:
elif (hda_state_counts[ states.QUEUED ] > 0 or
hda_state_counts[states.NEW] > 0):
state = states.QUEUED
elif (hda_state_counts[states.ERROR] > 0 or
hda_state_counts[states.FAILED_METADATA] > 0):
Expand Down
4 changes: 4 additions & 0 deletions lib/galaxy/managers/workflows.py
Expand Up @@ -334,6 +334,10 @@ def _workflow_to_dict_editor(self, trans, stored):
# FIXME: Frontend should be able to handle workflow messages
# as a dictionary not just the values
data['upgrade_messages'][step.order_index] = upgrade_message.values()
# Dispay version/tool_id changes
data['upgrade_messages'] = [step.order_index][module.tool.name] = "\n".join( module.version_changes )
elif (hasattr(module, "version_changes")) and (module.version_changes):
data['upgrade_messages'] = {step.order_index: {module.tool.name: "\n".join( module.version_changes )}}
# Get user annotation.
step_annotation = self.get_item_annotation_obj( trans.sa_session, trans.user, step )
annotation_str = ""
Expand Down
12 changes: 8 additions & 4 deletions lib/galaxy/model/__init__.py
Expand Up @@ -14,7 +14,7 @@
import socket
import time
from datetime import datetime, timedelta
from itertools import ifilter
from itertools import ifilter, imap
from string import Template
from uuid import UUID, uuid4

Expand Down Expand Up @@ -1078,6 +1078,10 @@ def __init__( self, user, group ):
self.group = group


def is_hda(d):
return isinstance( d, HistoryDatasetAssociation )


class History( object, Dictifiable, UsesAnnotations, HasName ):

dict_collection_visible_keys = ( 'id', 'name', 'published', 'deleted' )
Expand Down Expand Up @@ -1151,7 +1155,7 @@ def add_datasets( self, sa_session, datasets, parent_id=None, genome_build=None,
""" Optimized version of add_dataset above that minimizes database
interactions when adding many datasets to history at once.
"""
all_hdas = all( map( lambda d: isinstance( d, HistoryDatasetAssociation ), datasets ) )
all_hdas = all( imap( is_hda, datasets ) )
optimize = len( datasets) > 1 and parent_id is None and all_hdas and set_hid and not quota
if optimize:
self.__add_datasets_optimized( datasets, genome_build=genome_build )
Expand All @@ -1173,11 +1177,11 @@ def __add_datasets_optimized( self, datasets, genome_build=None ):
n = len( datasets )

base_hid = self._next_hid( n=n )

set_genome = genome_build not in [None, '?']
for i, dataset in enumerate( datasets ):
dataset.hid = base_hid + i
dataset.history = self
if genome_build not in [None, '?']:
if set_genome:
self.genome_build = genome_build
self.datasets.extend( datasets )
return datasets
Expand Down
17 changes: 8 additions & 9 deletions lib/galaxy/tools/__init__.py
Expand Up @@ -1342,14 +1342,14 @@ def handle_input( self, trans, incoming, history=None, source='html' ):
else:
raise exceptions.MessageException( execution_tracker.execution_errors[ 0 ] )

def handle_single_execution( self, trans, rerun_remap_job_id, params, history, mapping_over_collection ):
def handle_single_execution( self, trans, rerun_remap_job_id, params, history, mapping_over_collection, execution_cache=None ):
"""
Return a pair with whether execution is successful as well as either
resulting output data or an error message indicating the problem.
"""
try:
params = self.__remove_meta_properties( params )
job, out_data = self.execute( trans, incoming=params, history=history, rerun_remap_job_id=rerun_remap_job_id, mapping_over_collection=mapping_over_collection )
job, out_data = self.execute( trans, incoming=params, history=history, rerun_remap_job_id=rerun_remap_job_id, mapping_over_collection=mapping_over_collection, execution_cache=execution_cache )
except httpexceptions.HTTPFound, e:
# if it's a paste redirect exception, pass it up the stack
raise e
Expand Down Expand Up @@ -2576,18 +2576,17 @@ def _compare_tool_version( self, trans, job ):
# for some reason jobs don't always keep track of the tool version.
message = ''
else:
message = 'This job was initially run with tool version "%s", which is currently not available. ' % tool_version
message = 'This job was run with tool version "%s", which is not available. ' % tool_version
if len( tools ) > 1:
message += 'You can re-run the job with the selected tool or choose another derivation of the tool.'
message += 'You can re-run the job with the selected tool or choose another version of the tool.'
else:
message += 'You can re-run the job with this tool version, which is a derivation of the original tool.'
message += 'You can re-run the job with this tool version, which is a different version of the original tool.'
else:
message = 'This job was run with tool id "%s", version "%s", which is not available. ' % ( tool_id, tool_version )
if len( tools ) > 1:
message = 'This job was initially run with tool version "%s", which is currently not available. ' % tool_version
message += 'You can re-run the job with the selected tool or choose another derivation of the tool.'
message += 'You can re-run the job with the selected tool id "%s" or choose another derivation of the tool.' % self.id
else:
message = 'This job was initially run with tool id "%s", version "%s", which is ' % ( tool_id, tool_version )
message += 'currently not available. You can re-run the job with this tool, which is a derivation of the original tool.'
message += 'You can re-run the job with tool id "%s", which is a derivation of the original tool.' % self.id
except Exception, e:
raise exceptions.MessageException( str( e ) )
return message
Expand Down

0 comments on commit 8c6d530

Please sign in to comment.