From 1e4821c64477452f54390458dac67161467315ba Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Tue, 20 Nov 2018 13:43:04 +0100 Subject: [PATCH] Provide element_identifier attribute in DatsetCollectionWrapper This allows accessing `$input1.element_identifier` for an `input1` of collection_type `list:pair`. --- lib/galaxy/tools/wrappers.py | 4 ++++ .../tools/identifier_collection.xml | 22 +++++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/tools/wrappers.py b/lib/galaxy/tools/wrappers.py index b19761cbc9a..7c3f2dbbce9 100644 --- a/lib/galaxy/tools/wrappers.py +++ b/lib/galaxy/tools/wrappers.py @@ -403,6 +403,10 @@ class DatasetCollectionWrapper(ToolParameterValueWrapper, HasDatasets): def is_collection(self): return True + @property + def element_identifier(self): + return self.name + @property def is_input_supplied(self): return self.__input_supplied diff --git a/test/functional/tools/identifier_collection.xml b/test/functional/tools/identifier_collection.xml index e5f0a3e4dcc..e4306558c2a 100644 --- a/test/functional/tools/identifier_collection.xml +++ b/test/functional/tools/identifier_collection.xml @@ -1,15 +1,33 @@ - + #for $input in $input1: echo '$input.element_identifier' >> 'output1'; #end for - + + + + + + + + + + + + + + + + + + +