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.
This commit is contained in:
Matthias Bernt
2020-11-11 13:57:07 +01:00
parent f236a73e16
commit 56df6160da
+3
View File
@@ -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: