File: 0024-grc-xml-converter-Supply-default-output_language.patch

package info (click to toggle)
gnuradio 3.10.12.0-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 41,196 kB
  • sloc: cpp: 191,540; python: 91,856; ansic: 2,292; xml: 999; fortran: 927; sh: 477; makefile: 50
file content (31 lines) | stat: -rw-r--r-- 1,108 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
From b4cbba12ff48d0b81f2ccce1121b466d2680323f Mon Sep 17 00:00:00 2001
From: Martin Braun <martin.braun@ettus.com>
Date: Thu, 23 Jan 2025 10:35:25 +0100
Subject: [PATCH 24/41] grc: xml converter: Supply default output_language

Old XML-based GRC files don't necessarily provide output_language, but
they only supported Python anyway, so we auto-populate that field.

Signed-off-by: Martin Braun <martin.braun@ettus.com>
---
 grc/converter/flow_graph.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/grc/converter/flow_graph.py b/grc/converter/flow_graph.py
index c03802aaa1..f3db83dff2 100644
--- a/grc/converter/flow_graph.py
+++ b/grc/converter/flow_graph.py
@@ -23,6 +23,10 @@ def from_xml(filename):
         file_format = _guess_file_format_1(data)
 
     data['metadata'] = {'file_format': file_format}
+    # Old XML-based flow graphs only supported Python, but didn't always declare
+    # that in the options. We'll default to Python if it's not set.
+    if 'output_language' not in data['options']:
+        data['options']['output_language'] = 'python'
 
     return data
 
-- 
2.47.3