summaryrefslogtreecommitdiff
path: root/grc/core/Param.py
diff options
context:
space:
mode:
authorJohnathan Corgan <johnathan@corganlabs.com>2017-08-03 14:53:16 -0700
committerJohnathan Corgan <johnathan@corganlabs.com>2017-08-03 14:53:16 -0700
commitf9dd0a8a347e97e08bc7644f0467e58dcaf1ca66 (patch)
treeb83fb21adc638772bcec2099b81587c1042923c1 /grc/core/Param.py
parenta6ed53ecd93cd6b1e0b4fdd627615e4e24697d04 (diff)
parent811bee8c54bdca5c53c2ccbc6ef6d1bbca55eaae (diff)
Merge branch 'master' into next
Diffstat (limited to 'grc/core/Param.py')
-rw-r--r--grc/core/Param.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/grc/core/Param.py b/grc/core/Param.py
index a9a664f74a..2077925879 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())