From 56df6160dac9af2ef8afdc7849eb40fca484fd0d Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Wed, 11 Nov 2020 13:57:07 +0100 Subject: [PATCH] allow access to metadata collection attributes follow up to https://github.com/galaxyproject/galaxy/pull/8599 in the planemo tests in the line https://github.com/bernt-matthias/galaxy/blob/1882aa641cdde1c51c077fd983f2241971308377/lib/galaxy/tools/parameters/dynamic_options.py#L205 r.metadata is sometimes a MetadataWrapper and sometimes a MetadataCollection in the former case acccess to the `element_is_set` function defined in MetadataCollection is not possible. --- lib/galaxy/tools/wrappers.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/galaxy/tools/wrappers.py b/lib/galaxy/tools/wrappers.py index ebf19c914ba..7d0ae0c56c8 100644 --- a/lib/galaxy/tools/wrappers.py +++ b/lib/galaxy/tools/wrappers.py @@ -214,6 +214,9 @@ class DatasetFilenameWrapper(ToolParameterValueWrapper): self.compute_environment = compute_environment def __getattr__(self, name): + if hasattr(self.metadata, name): + return getattr(self.metadata, name) + rval = self.metadata.get(name, None) if name in self.metadata.spec: if rval is None: