2 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/1da2068fa58c/ changeset: 1da2068fa58c user: dannon date: 2013-03-05 22:15:54 summary: Fix workflow modules imports. affected #: 1 file diff -r f7904535003fdf8e56588fb78ebcdf9af913cc55 -r 1da2068fa58c5f1ac9d4bee510644a1dce20e814 lib/galaxy/workflow/modules.py --- a/lib/galaxy/workflow/modules.py +++ b/lib/galaxy/workflow/modules.py @@ -1,13 +1,20 @@ +""" +Modules used in building workflows +""" + +import logging import re + from elementtree.ElementTree import Element + +import galaxy.tools from galaxy import web -from galaxy.tools.parameters import DataToolParameter, DummyDataset, RuntimeValue, check_param, visit_input_values -import galaxy.tools +from galaxy.jobs.actions.post import ActionBox +from galaxy.model import PostJobAction +from galaxy.tools.parameters import check_param, DataToolParameter, DummyDataset, RuntimeValue, visit_input_values from galaxy.util.bunch import Bunch from galaxy.util.json import from_json_string, to_json_string -from galaxy.jobs.actions.post import ActionBox -from galaxy.model import PostJobAction -import logging + log = logging.getLogger( __name__ ) https://bitbucket.org/galaxy/galaxy-central/commits/26006e793a32/ changeset: 26006e793a32 user: dannon date: 2013-03-05 22:18:16 summary: Workflow modules: Adjust spacing to new guidelines. affected #: 1 file diff -r 1da2068fa58c5f1ac9d4bee510644a1dce20e814 -r 26006e793a32a35328d941f6cea573b0108faab7 lib/galaxy/workflow/modules.py --- a/lib/galaxy/workflow/modules.py +++ b/lib/galaxy/workflow/modules.py @@ -15,8 +15,8 @@ from galaxy.util.bunch import Bunch from galaxy.util.json import from_json_string, to_json_string +log = logging.getLogger( __name__ ) -log = logging.getLogger( __name__ ) class WorkflowModule( object ): @@ -31,6 +31,7 @@ Create a new instance of the module with default state """ return Class( trans ) + @classmethod def from_dict( Class, trans, d ): """ @@ -38,6 +39,7 @@ dictionary `d`. """ return Class( trans ) + @classmethod def from_workflow_step( Class, trans, step ): return Class( trans ) @@ -51,10 +53,13 @@ def get_type( self ): return self.type + def get_name( self ): return self.name + def get_tool_id( self ): return None + def get_tooltip( self, static_path='' ): return None @@ -62,14 +67,19 @@ def get_state( self ): return None + def get_errors( self ): return None + def get_data_inputs( self ): return [] + def get_data_outputs( self ): return [] + def update_state( self ): pass + def get_config_form( self ): raise TypeError( "Abstract method" ) @@ -84,18 +94,23 @@ def get_runtime_inputs( self ): raise TypeError( "Abstract method" ) + def get_runtime_state( self ): raise TypeError( "Abstract method" ) + def encode_runtime_state( self, trans, state ): raise TypeError( "Abstract method" ) + def decode_runtime_state( self, trans, string ): raise TypeError( "Abstract method" ) + def update_runtime_state( self, trans, state, values ): raise TypeError( "Abstract method" ) def execute( self, trans, state ): raise TypeError( "Abstract method" ) + class InputDataModule( WorkflowModule ): type = "data_input" name = "Input dataset" @@ -105,12 +120,14 @@ module = Class( trans ) module.state = dict( name="Input Dataset" ) return module + @classmethod def from_dict( Class, trans, d, secure=True ): module = Class( trans ) state = from_json_string( d["tool_state"] ) module.state = dict( name=state.get( "name", "Input Dataset" ) ) return module + @classmethod def from_workflow_step( Class, trans, step ): module = Class( trans ) @@ -172,6 +189,7 @@ def execute( self, trans, state ): return None, dict( output=state.inputs['input']) + class ToolModule( WorkflowModule ): type = "tool" @@ -286,6 +304,7 @@ def get_data_inputs( self ): data_inputs = [] + def callback( input, value, prefixed_name, prefixed_label ): if isinstance( input, DataToolParameter ): data_inputs.append( dict( @@ -293,6 +312,7 @@ label=prefixed_label, multiple=input.multiple, extensions=input.extensions ) ) + visit_input_values( self.tool.inputs, self.state.inputs, callback ) return data_inputs @@ -338,6 +358,7 @@ make_runtime_key = incoming.get( 'make_runtime', None ) make_buildtime_key = incoming.get( 'make_buildtime', None ) + def item_callback( trans, key, input, value, error, old_value, context ): # Dummy value for Data parameters if isinstance( input, DataToolParameter ): @@ -354,6 +375,7 @@ return value, None else: return value, error + # Update state using incoming values errors = self.tool.update_state( self.trans, self.tool.inputs, self.state.inputs, incoming, item_callback=item_callback ) self.errors = errors or None @@ -370,6 +392,7 @@ input_connections_by_name = {} # Any connected input needs to have value DummyDataset (these # are not persisted so we need to do it every time) + def callback( input, value, prefixed_name, prefixed_label ): replacement = None if isinstance( input, DataToolParameter ): @@ -379,9 +402,12 @@ else: replacement = DummyDataset() return replacement + visit_input_values( self.tool.inputs, self.state.inputs, callback ) + class WorkflowModuleFactory( object ): + def __init__( self, module_types ): self.module_types = module_types 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.