commit/galaxy-central: dannon: Fix for Input Dataset datatype filtering regression introduced in 6329:ab90893a7cf5.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/c60760713d26/ changeset: c60760713d26 user: dannon date: 2012-01-25 18:12:05 summary: Fix for Input Dataset datatype filtering regression introduced in 6329:ab90893a7cf5. Input Dataset steps will now again properly filter appropriate input datasets based on subsequent tool input types. affected #: 2 files diff -r f9da9ca5ccae7ead780d0331102cda204e38d646 -r c60760713d26558d6733367709433d8eefbd64ca lib/galaxy/tools/parameters/basic.py --- a/lib/galaxy/tools/parameters/basic.py +++ b/lib/galaxy/tools/parameters/basic.py @@ -486,7 +486,7 @@ return value def get_initial_value( self, trans, context ): return None - + class HiddenToolParameter( ToolParameter ): """ Parameter that takes one of two values. @@ -816,7 +816,7 @@ for t, v, s in options: if v in value: rval.append( t ) - return "\n".join( rval ) + suffix + return "\n".join( rval ) + suffix def get_dependencies( self ): """ Get the *names* of the other params this param depends on. @@ -1326,7 +1326,7 @@ Nate's next pass at the dataset security stuff will dramatically alter this anyway. """ - def __init__( self, tool, elem ): + def __init__( self, tool, elem, trans=None): ToolParameter.__init__( self, tool, elem ) # Add metadata validator if not string_as_bool( elem.get( 'no_validation', False ) ): @@ -1337,11 +1337,16 @@ for extension in self.extensions: extension = extension.strip() if tool is None: - #This occurs for things such as unit tests - import galaxy.datatypes.registry - datatypes_registry = galaxy.datatypes.registry.Registry() - datatypes_registry.load_datatypes() - formats.append( datatypes_registry.get_datatype_by_extension( extension.lower() ).__class__ ) + if trans: + # Must account for "Input Dataset" types, which while not a tool still need access to the real registry. + # A handle to the transaction (and thus app) will be given by the module. + formats.append( trans.app.datatypes_registry.get_datatype_by_extension( extension.lower() ).__class__ ) + else: + #This occurs for things such as unit tests + import galaxy.datatypes.registry + datatypes_registry = galaxy.datatypes.registry.Registry() + datatypes_registry.load_datatypes() + formats.append( datatypes_registry.get_datatype_by_extension( extension.lower() ).__class__ ) else: formats.append( tool.app.datatypes_registry.get_datatype_by_extension( extension.lower() ).__class__ ) self.formats = tuple( formats ) diff -r f9da9ca5ccae7ead780d0331102cda204e38d646 -r c60760713d26558d6733367709433d8eefbd64ca lib/galaxy/workflow/modules.py --- a/lib/galaxy/workflow/modules.py +++ b/lib/galaxy/workflow/modules.py @@ -134,7 +134,7 @@ def get_runtime_inputs( self, filter_set=['data'] ): label = self.state.get( "name", "Input Dataset" ) - return dict( input=DataToolParameter( None, Element( "param", name="input", label=label, multiple=True, type="data", format=', '.join(filter_set) ) ) ) + return dict( input=DataToolParameter( None, Element( "param", name="input", label=label, multiple=True, type="data", format=', '.join(filter_set) ), self.trans ) ) def get_runtime_state( self ): state = DefaultToolState() state.inputs = dict( input=None ) 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)
-
Bitbucket