summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrennan Ashton <bashton@brennanashton.com>2018-11-03 12:05:34 -0700
committerMartin Braun <martin.braun@ettus.com>2018-11-20 11:17:34 -0800
commit546c02b0af57481afe03e90ecbd90e8bdbbdac42 (patch)
tree015705eae0e5a8b48621e01bbb152335d506b5c4
parenta136dc05acedccbd5bff63aa88464e361df77c0d (diff)
grc: Fix Struct Variable template bug converting from Cheetah to Mako
Template was still using Cheetah getVar instead of Mako's context accessor. Fixes: #2051
-rw-r--r--grc/blocks/variable_struct.block.yml.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/grc/blocks/variable_struct.block.yml.py b/grc/blocks/variable_struct.block.yml.py
index 19b29982e7..b597f41a6c 100644
--- a/grc/blocks/variable_struct.block.yml.py
+++ b/grc/blocks/variable_struct.block.yml.py
@@ -17,10 +17,11 @@ templates:
self.${{id}} = ${{id}} = struct({{
% for i in range({0}):
<%
- field = getVar('field' + str(i))
+ field = context.get('field' + str(i))
+ value = context.get('value' + str(i))
%>
% if len(str(field)) > 2:
- ${{field}}: getVar('value' + str(i)),
+ ${{field}}: ${{value}},
% endif
% endfor
}})
@@ -28,10 +29,10 @@ templates:
struct({{
% for i in range({0}):
<%
- field = getVar('field' + str(i))
+ field = context.get('field' + str(i))
%>
% if len(str(field)) > 2:
- ${{field}}: getVar('field' + str(i)),
+ ${{field}}: ${{field}},
% endif
% endfor
}})
@@ -42,7 +43,7 @@ FIELD0 = """\
label: Field 0
category: Fields
dtype: string
- default: ${field0}
+ default: field0
hide: part
"""