diff options
Diffstat (limited to 'grc/core/Param.py')
-rw-r--r-- | grc/core/Param.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/grc/core/Param.py b/grc/core/Param.py index afa478b3a2..00c9e7d827 100644 --- a/grc/core/Param.py +++ b/grc/core/Param.py @@ -135,6 +135,14 @@ class TemplateArg(object): def __getitem__(self, item): return str(self._param.get_opt(item)) if self._param.is_enum() else NotImplemented + def __getattr__(self, item): + if not self._param.is_enum(): + raise AttributeError() + try: + return str(self._param.get_opt(item)) + except KeyError: + raise AttributeError() + def __str__(self): return str(self._param.to_code()) |