diff options
author | Johnathan Corgan <johnathan@corganlabs.com> | 2017-08-03 14:14:22 -0700 |
---|---|---|
committer | Johnathan Corgan <johnathan@corganlabs.com> | 2017-08-03 14:14:22 -0700 |
commit | dea13b30e411b5239c39dd63bc13f5344c945701 (patch) | |
tree | b8b033c7f12847f117d8b6283ba2797c3e8d3312 /grc/core/Param.py | |
parent | 3b3a403e8871bdb83f8cd9bdc904626de14a7cca (diff) | |
parent | 3aae388352bd78f48cbe75efab989187fee271bb (diff) |
Merge branch 'maint'
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()) |