Merge remote-tracking branch 'galaxyproject/dev' into azure-blob-objectstore

This commit is contained in:
Alexander Lenail
2016-07-19 15:25:43 -04:00
13 changed files with 55 additions and 37 deletions
@@ -372,7 +372,7 @@ define([ 'utils/utils', 'utils/deferred', 'mvc/ui/ui-misc', 'mvc/form/form-view'
Galaxy.emit.debug( 'tool-form-composite::submit()', 'Validation complete.', job_def );
Utils.request({
type : 'POST',
url : Galaxy.root + 'api/workflows/' + this.model.id + '/run',
url : Galaxy.root + 'api_internal/workflows/' + this.model.id + '/run',
data : job_def,
success : function( response ) {
Galaxy.emit.debug( 'tool-form-composite::submit', 'Submission successful.', response );
@@ -477,4 +477,4 @@ define([ 'utils/utils', 'utils/deferred', 'mvc/ui/ui-misc', 'mvc/form/form-view'
return {
View: View
};
});
});
+2 -2
View File
@@ -975,7 +975,7 @@ def get_file_peek( file_name, is_multi_byte=False, WIDTH=256, LINE_COUNT=5, skip
data_checked = False
temp = open( file_name, "U" )
last_line = ''
while count <= LINE_COUNT:
while count < LINE_COUNT:
line = last_line + temp.readline( WIDTH - len( last_line ) )
if line and not is_multi_byte and not data_checked:
# See if we have a compressed or binary file
@@ -993,7 +993,7 @@ def get_file_peek( file_name, is_multi_byte=False, WIDTH=256, LINE_COUNT=5, skip
if not line_wrap:
if '\n' in line:
i = line.index( '\n' )
last_line = line[i:]
last_line = line[i + 1:]
line = line[:i]
else:
last_line = ''
+10 -3
View File
@@ -427,13 +427,20 @@ class DeleteIntermediatesAction(DefaultJobAction):
else:
log.debug("No job found yet for wfi_step %s, (step %s)" % (wfi_step, wfi_step.workflow_step))
for j2c in jobs_to_check:
sa_session.refresh(j2c)
creating_jobs = []
for input_dataset in j2c.input_datasets:
if not input_dataset.dataset:
log.debug("PJA Async Issue: No dataset attached to input_dataset %s during handling of workflow invocation %s" % (input_dataset.id, wfi))
elif not input_dataset.dataset.creating_job:
log.debug("PJA Async Issue: No creating job attached to dataset %s during handling of workflow invocation %s" % (input_dataset.dataset.id, wfi))
else:
creating_jobs.append((input_dataset, input_dataset.dataset.creating_job))
for (input_dataset, creating_job) in creating_jobs:
sa_session.refresh(creating_job)
sa_session.refresh(input_dataset)
sa_session.refresh(input_dataset.dataset.creating_job)
creating_jobs.append( (input_dataset, input_dataset.dataset.creating_job) )
for input_dataset in [x.dataset for (x, creating_job) in creating_jobs if creating_job.workflow_invocation_step and creating_job.workflow_invocation_step.workflow_invocation == wfi]:
# note that the above input_dataset is a reference to a
# job.input_dataset.dataset at this point
safe_to_delete = True
for job_to_check in [d_j.job for d_j in input_dataset.dependent_jobs]:
if job_to_check != job and job_to_check.state not in [job.states.OK, job.states.DELETED]:
+1 -1
View File
@@ -88,7 +88,7 @@ class WorkflowsAPIController(BaseAPIController, UsesStoredWorkflowMixin, UsesAnn
@expose_api
def run( self, trans, workflow_id, payload, **kwd ):
"""
POST /api/workflows/{encoded_workflow_id}/run
POST /api_internal/workflows/{encoded_workflow_id}/run
Run a workflow with a dictionary of prefixed_name/value pairs e.g.
payload = { inputs: { step_0: { parameter_0|parameter_1 : value_0, ... }, ... } }
+1 -1
View File
@@ -271,7 +271,7 @@ def populate_api_routes( webapp, app ):
webapp.mapper.resource( 'genome', 'genomes', path_prefix='/api' )
webapp.mapper.resource( 'visualization', 'visualizations', path_prefix='/api' )
webapp.mapper.connect( '/api/workflows/build_module', action='build_module', controller="workflows" )
webapp.mapper.connect( '/api/workflows/{workflow_id}/run', action='run', controller="workflows", conditions=dict( method=['POST'] ) )
webapp.mapper.connect( '/api_internal/workflows/{workflow_id}/run', action='run', controller="workflows", conditions=dict( method=['POST'] ) )
webapp.mapper.resource( 'workflow', 'workflows', path_prefix='/api' )
webapp.mapper.resource_with_deleted( 'history', 'histories', path_prefix='/api' )
webapp.mapper.connect( '/api/histories/{history_id}/citations', action='citations', controller="histories" )
@@ -650,7 +650,7 @@ class DownloadBinary( Download, RecipeStep ):
url_template_elem = tool_dependency_util.get_download_url_for_platform( url_template_elems, platform_info_dict )
else:
url_template_elem = url_template_elems[ 0 ]
action_dict[ 'url' ] = Template( url_template_elem.text ).safe_substitute( platform_info_dict )
action_dict[ 'url' ] = Template( url_template_elem.text.strip() ).safe_substitute( platform_info_dict )
action_dict[ 'target_directory' ] = action_elem.get( 'target_directory', None )
action_dict.update( self.get_elem_checksums( action_elem ) )
return action_dict
@@ -1175,7 +1175,7 @@ class SetupPerlEnvironment( Download, RecipeStep ):
def __init__( self, app ):
self.app = app
self.type = 'setup_purl_environment'
self.type = 'setup_perl_environment'
def execute_step( self, tool_dependency, package_name, actions, action_dict, filtered_actions, env_file_builder,
install_environment, work_dir, current_dir=None, initial_download=False ):
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+11
View File
@@ -0,0 +1,11 @@
"""
Unit tests for base DataTypes.
.. seealso:: galaxy.datatypes.data
"""
from galaxy.datatypes.data import get_file_peek
def test_get_file_peek( ):
# should get the first 5 lines of the file without a trailing newline character
assert get_file_peek('test-data/1.tabular', line_wrap=False) == 'chr22\t1000\tNM_17\nchr22\t2000\tNM_18\nchr10\t2200\tNM_10\nchr10\thap\ttest\nchr10\t1200\tNM_11'