commit/galaxy-central: guerler: Workflow: Fix text and boolean parameter handling, simplify module update
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/2f436edb5288/ Changeset: 2f436edb5288 User: guerler Date: 2015-02-05 15:08:45+00:00 Summary: Workflow: Fix text and boolean parameter handling, simplify module update Affected #: 3 files diff -r 6133a80c7a08b88f1e7d2e83456acdc329b88b47 -r 2f436edb5288bf750382ae1ccddd95ed611db6a1 lib/galaxy/tools/parameters/basic.py --- a/lib/galaxy/tools/parameters/basic.py +++ b/lib/galaxy/tools/parameters/basic.py @@ -263,8 +263,15 @@ else: return form_builder.TextField( self.name, self.size, value ) + def to_string( self, value, app ): + """Convert a value to a string representation suitable for persisting""" + if value is None: + return '' + else: + return str( value ) + def to_html_value( self, value, app ): - if not value: + if value is None: return '' else: return self.to_string( value, app ) @@ -335,13 +342,6 @@ return "" raise ValueError( "An integer is required" ) - def to_string( self, value, app ): - """Convert a value to a string representation suitable for persisting""" - if value is None: - return "" - else: - return str( value ) - def to_python( self, value, app ): try: return int( value ) @@ -414,13 +414,6 @@ return "" raise ValueError( "A real number is required" ) - def to_string( self, value, app ): - """Convert a value to a string representation suitable for persisting""" - if value is None: - return "" - else: - return str( value ) - def to_python( self, value, app ): try: return float( value ) @@ -480,7 +473,7 @@ return [ 'true' ] def to_python( self, value, app ): - return ( value == 'True' ) + return ( value in [ 'True', 'true' ]) def get_initial_value( self, trans, context, history=None ): return self.checked diff -r 6133a80c7a08b88f1e7d2e83456acdc329b88b47 -r 2f436edb5288bf750382ae1ccddd95ed611db6a1 lib/galaxy/webapps/galaxy/controllers/workflow.py --- a/lib/galaxy/webapps/galaxy/controllers/workflow.py +++ b/lib/galaxy/webapps/galaxy/controllers/workflow.py @@ -619,17 +619,25 @@ } ) # create tool model and default tool state (if missing) - tool_model = None if type == 'tool' and not tool_state: tool_model = module.tool.to_json(trans, **incoming) module.state.inputs = copy.deepcopy(tool_model['state_inputs']) + return { + 'tool_model': tool_model, + 'tool_state': module.get_state(), + 'data_inputs': module.get_data_inputs(), + 'data_outputs': module.get_data_outputs(), + 'tool_errors': module.get_errors(), + 'form_html': module.get_config_form(), + 'annotation': annotation, + 'post_job_actions': module.get_post_job_actions(incoming) + } # update module state module.update_state( incoming ) if type == 'tool': return { - 'tool_model': tool_model, 'tool_state': module.get_state(), 'data_inputs': module.get_data_inputs(), 'data_outputs': module.get_data_outputs(), diff -r 6133a80c7a08b88f1e7d2e83456acdc329b88b47 -r 2f436edb5288bf750382ae1ccddd95ed611db6a1 lib/galaxy/workflow/modules.py --- a/lib/galaxy/workflow/modules.py +++ b/lib/galaxy/workflow/modules.py @@ -684,8 +684,11 @@ input_dicts.append( { "name": name, "description": "runtime parameter for tool %s" % self.get_name() } ) return input_dicts - def get_post_job_actions( self ): - return self.post_job_actions + def get_post_job_actions( self, incoming=None): + if incoming is None: + return self.post_job_actions + else: + return ActionBox.handle_incoming(incoming) def get_config_form( self ): self.add_dummy_datasets() Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org