SHA256
1
0
forked from pool/brickv
brickv/0001-red-Handle-service-provider-country-codes-missing-in.patch

37 lines
1.5 KiB
Diff
Raw Normal View History

From 38339ae4a102acf13c250aa962d45acae5624b52 Mon Sep 17 00:00:00 2001
From: Erik Fleckstein <erik@tinkerforge.com>
Date: Wed, 27 Jul 2022 14:37:49 +0200
Subject: [PATCH] red: Handle service provider country codes missing in
ISO-3166 database.
---
.../plugin_system/plugins/red/build_serviceproviders.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/brickv/plugin_system/plugins/red/build_serviceproviders.py b/src/brickv/plugin_system/plugins/red/build_serviceproviders.py
index 3b7d95ca..87a11c93 100644
--- a/src/brickv/plugin_system/plugins/red/build_serviceproviders.py
+++ b/src/brickv/plugin_system/plugins/red/build_serviceproviders.py
@@ -3,7 +3,7 @@
"""
Copyright (C) 2015 Ishraq Ibne Ashraf <ishraq@tinkerforge.com>
Copyright (C) 2015 Matthias Bolte <matthias@tinkerforge.com>
-Copyright (C) 2020 Erik Fleckstein <erik@tinkerforge.com>
+Copyright (C) 2020, 2022 Erik Fleckstein <erik@tinkerforge.com>
build_serviceproviders.py: Generate python dicts for mobile internet feature
@@ -114,6 +114,9 @@ def main():
for dict_c in dict_provider['country']:
code_country = dict_c['@code']
+ if code_country.upper() not in dict_country_all:
+ print(' Skipping country with code {}: not found in ISO-3166 database'.format(code_country))
+ continue
dict_country[code_country] = dict_country_all[code_country.upper()]
except Exception as e:
--
2.37.1