Skip to content

Commit

Permalink
Merge pull request #544 from jmchilton/collection_actions
Browse files Browse the repository at this point in the history
Update output actions code for some collection operations.
  • Loading branch information
carlfeberhard committed Aug 7, 2015
2 parents 2a8aea0 + 1dd4694 commit f49fc1c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/galaxy/tools/parameters/output.py
Expand Up @@ -10,6 +10,9 @@

log = logging.getLogger( __name__ )

# Attributes tool developer may want to query on dataset collections.
COLLECTION_ATTRIBUTES = [ "collection_type" ]


class ToolOutputActionGroup( object ):
"""
Expand Down Expand Up @@ -235,6 +238,13 @@ def get_value( self, other_values ):
value = value[0]
elif isinstance(value, dict):
value = value[ attr_name ]
elif hasattr( value, "collection" ) and value not in COLLECTION_ATTRIBUTES:
# if this is an HDCA for instance let reverse.ext grab
# the reverse element and then continue for loop to grab
# dataset extension
value = value.collection[ attr_name ].element_object
elif hasattr( value, "collection" ) and value in COLLECTION_ATTRIBUTES:
value = getattr( value.collection, attr_name )
else:
value = getattr( value, attr_name )
options = [ [ str( value ) ] ]
Expand Down

0 comments on commit f49fc1c

Please sign in to comment.