From 18ab9f94f56a9f31c0f79fbba4363dd539066da8 Mon Sep 17 00:00:00 2001
From: Mike Walters <mike@flomp.net>
Date: Tue, 28 Jul 2020 21:28:05 +0100
Subject: [PATCH] grc: Fix YML block generation

This fixes the template syntax that removes a set of variables from sink
blocks. Previously, this was causing NameErrors when trying to generate
a flowgraph containing a sink block.
---
 grc/gen_osmosdr_blocks.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/grc/gen_osmosdr_blocks.py b/grc/gen_osmosdr_blocks.py
index 840320ab4e..bfe81f23c4 100644
--- a/grc/gen_osmosdr_blocks.py
+++ b/grc/gen_osmosdr_blocks.py
@@ -122,11 +122,11 @@ templates:
     ${'%'} if context.get('nchan')() > ${n}:
     self.${'$'}{id}.set_center_freq(${'$'}{${'freq' + str(n)}}, ${n})
     self.${'$'}{id}.set_freq_corr(${'$'}{${'corr' + str(n)}}, ${n})
-    ${'%'} if context.get('sourk') == 'source':
+    % if sourk == 'source':
     self.${'$'}{id}.set_dc_offset_mode(${'$'}{${'dc_offset_mode' + str(n)}}, ${n})
     self.${'$'}{id}.set_iq_balance_mode(${'$'}{${'iq_balance_mode' + str(n)}}, ${n})
     self.${'$'}{id}.set_gain_mode(${'$'}{${'gain_mode' + str(n)}}, ${n})
-    ${'%'} endif
+    % endif
     self.${'$'}{id}.set_gain(${'$'}{${'gain' + str(n)}}, ${n})
     self.${'$'}{id}.set_if_gain(${'$'}{${'if_gain' + str(n)}}, ${n})
     self.${'$'}{id}.set_bb_gain(${'$'}{${'bb_gain' + str(n)}}, ${n})
-- 
2.25.1

