mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-24 02:04:04 +08:00
fix old jobparam hack for importing files to library
This commit is contained in:
@@ -350,7 +350,7 @@ def create_paramfile( trans, uploaded_datasets ):
|
||||
return json_file_path
|
||||
|
||||
|
||||
def create_job( trans, params, tool, json_file_path, data_list, folder=None, history=None ):
|
||||
def create_job( trans, params, tool, json_file_path, data_list, folder=None, history=None, job_params=None ):
|
||||
"""
|
||||
Create the upload job.
|
||||
"""
|
||||
@@ -395,7 +395,10 @@ def create_job( trans, params, tool, json_file_path, data_list, folder=None, his
|
||||
# open( dataset.file_name, "w" ).close()
|
||||
job.object_store_id = object_store_id
|
||||
job.set_state( job.states.NEW )
|
||||
job.set_handler(tool.get_job_handler(None))
|
||||
job.set_handler( tool.get_job_handler( None ) )
|
||||
if job_params:
|
||||
for name, value in job_params.iteritems():
|
||||
job.add_parameter( name, value )
|
||||
trans.sa_session.add( job )
|
||||
trans.sa_session.flush()
|
||||
|
||||
|
||||
@@ -517,10 +517,10 @@ class LibraryDatasetsController( BaseAPIController, UsesVisualizationMixin ):
|
||||
abspath_datasets.append( ud )
|
||||
json_file_path = upload_common.create_paramfile( trans, abspath_datasets )
|
||||
data_list = [ ud.data for ud in abspath_datasets ]
|
||||
job, output = upload_common.create_job( trans, tool_params, tool, json_file_path, data_list, folder=folder )
|
||||
# HACK: Prevent outputs_to_working_directory from overwriting inputs when "linking"
|
||||
job.add_parameter( 'link_data_only', dumps( kwd.get( 'link_data_only', 'copy_files' ) ) )
|
||||
job.add_parameter( 'uuid', dumps( kwd.get( 'uuid', None ) ) )
|
||||
job_params = {}
|
||||
job_params['link_data_only'] = dumps( kwd.get( 'link_data_only', 'copy_files' ) )
|
||||
job_params['uuid'] = dumps( kwd.get( 'uuid', None ) )
|
||||
job, output = upload_common.create_job( trans, tool_params, tool, json_file_path, data_list, folder=folder, job_params=job_params )
|
||||
trans.sa_session.add( job )
|
||||
trans.sa_session.flush()
|
||||
job_dict = job.to_dict()
|
||||
|
||||
@@ -1115,10 +1115,10 @@ class LibraryCommon( BaseUIController, UsesFormDefinitionsMixin, UsesExtendedMet
|
||||
status='error' ) )
|
||||
json_file_path = upload_common.create_paramfile( trans, uploaded_datasets )
|
||||
data_list = [ ud.data for ud in uploaded_datasets ]
|
||||
job, output = upload_common.create_job( trans, tool_params, tool, json_file_path, data_list, folder=library_bunch.folder )
|
||||
# HACK: Prevent outputs_to_working_directory from overwriting inputs when "linking"
|
||||
job.add_parameter( 'link_data_only', dumps( kwd.get( 'link_data_only', 'copy_files' ) ) )
|
||||
job.add_parameter( 'uuid', dumps( kwd.get( 'uuid', None ) ) )
|
||||
job_params = {}
|
||||
job_params['link_data_only'] = dumps( kwd.get( 'link_data_only', 'copy_files' ) )
|
||||
job_params['uuid'] = dumps( kwd.get( 'uuid', None ) )
|
||||
job, output = upload_common.create_job( trans, tool_params, tool, json_file_path, data_list, folder=library_bunch.folder, job_params=job_params )
|
||||
trans.sa_session.add( job )
|
||||
trans.sa_session.flush()
|
||||
return output
|
||||
|
||||
Reference in New Issue
Block a user