mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Merge remote-tracking branch 'upstream/release_15.05' into dev
This commit is contained in:
@@ -349,7 +349,7 @@ class PulsarJobRunner( AsynchronousJobRunner ):
|
||||
|
||||
encoded_job_id = self.app.security.encode_id(job_id)
|
||||
job_key = self.app.security.encode_id( job_id, kind="jobs_files" )
|
||||
endpoint_base = "%s/api/jobs/%s?job_key=%s"
|
||||
endpoint_base = "%s/api/jobs/%s/files?job_key=%s"
|
||||
if self.app.config.nginx_upload_job_files_path:
|
||||
endpoint_base = "%s" + \
|
||||
self.app.config.nginx_upload_job_files_path + \
|
||||
|
||||
@@ -671,41 +671,19 @@ class ColorToolParameter( ToolParameter ):
|
||||
def get_initial_value( self, trans, context, history=None ):
|
||||
return self.value.lower();
|
||||
|
||||
## This is clearly a HACK, parameters should only be used for things the user
|
||||
## can change, there needs to be a different way to specify this. I'm leaving
|
||||
## it for now to avoid breaking any tools.
|
||||
|
||||
|
||||
class BaseURLToolParameter( ToolParameter ):
|
||||
class BaseURLToolParameter( HiddenToolParameter ):
|
||||
"""
|
||||
Returns a parameter the contains its value prepended by the
|
||||
Returns a parameter that contains its value prepended by the
|
||||
current server base url. Used in all redirects.
|
||||
"""
|
||||
|
||||
def __init__( self, tool, input_source ):
|
||||
input_source = ensure_input_source( input_source )
|
||||
ToolParameter.__init__( self, tool, input_source )
|
||||
super( BaseURLToolParameter, self ).__init__( tool, input_source )
|
||||
self.value = input_source.get( 'value', '' )
|
||||
|
||||
def get_value( self, trans ):
|
||||
# url = trans.request.base + self.value
|
||||
url = url_for( self.value, qualified=True )
|
||||
return url
|
||||
|
||||
def get_html_field( self, trans=None, value=None, other_values={} ):
|
||||
return form_builder.HiddenField( self.name, self.get_value( trans ) )
|
||||
|
||||
def get_initial_value( self, trans, context, history=None ):
|
||||
return self.get_value( trans )
|
||||
|
||||
def get_label( self ):
|
||||
# BaseURLToolParameters are ultimately "hidden" parameters
|
||||
return None
|
||||
|
||||
def to_dict( self, trans, view='collection', value_mapper=None, other_values={} ):
|
||||
d = super( BaseURLToolParameter, self ).to_dict( trans )
|
||||
d['value'] = self.get_value( trans )
|
||||
return d
|
||||
def from_html( self, value=None, trans=None, context={} ):
|
||||
return url_for( self.value, qualified=True )
|
||||
|
||||
|
||||
DEFAULT_VALUE_MAP = lambda x: x
|
||||
@@ -1656,7 +1634,7 @@ class BaseDataToolParameter( ToolParameter ):
|
||||
class_name = self.__class__.__name__
|
||||
assert trans is not None, "%s requires a trans" % class_name
|
||||
if history is None:
|
||||
history = trans.get_history()
|
||||
history = trans.get_history( create=True )
|
||||
assert history is not None, "%s requires a history" % class_name
|
||||
return history
|
||||
|
||||
|
||||
@@ -150,7 +150,7 @@ class DataToolParameterTestCase( BaseParameterTestCase ):
|
||||
self.app.model.context.flush()
|
||||
self.trans = bunch.Bunch(
|
||||
app=self.app,
|
||||
get_history=lambda: self.test_history,
|
||||
get_history=lambda **k: self.test_history,
|
||||
get_current_user_roles=lambda: [],
|
||||
workflow_building_mode=False,
|
||||
webapp=bunch.Bunch( name="galaxy" ),
|
||||
|
||||
@@ -478,7 +478,7 @@ class MockTrans( object ):
|
||||
self.webapp = Bunch( name="galaxy" )
|
||||
self.sa_session = self.app.model.context
|
||||
|
||||
def get_history( self ):
|
||||
def get_history( self, **kwargs ):
|
||||
return self.history
|
||||
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ class MockTrans( object ):
|
||||
|
||||
user = property( get_user, set_user )
|
||||
|
||||
def get_history( self ):
|
||||
def get_history( self, **kwargs ):
|
||||
return self.history
|
||||
|
||||
def set_history( self, history ):
|
||||
|
||||
Reference in New Issue
Block a user