could do extra['myvariable'] in templates

This commit is contained in:
2021-05-22 16:32:22 +02:00
parent ed1ee9e8a6
commit 38b30c12b4
13 changed files with 283 additions and 0 deletions

View File

@ -184,6 +184,11 @@ class RougailExtra:
except KeyError:
raise AttributeError(f'unable to find extra "{key}"')
def __getitem__(self,
key: str,
) -> Any:
return self.__getattr__(key)
def __iter__(self):
return iter(self._suboption.values())