From faebdd5a0daa5fa3dd4b75ac1b341e79d26c83d8 Mon Sep 17 00:00:00 2001 From: Alejandro Sirgo Rica Date: Wed, 21 Aug 2024 13:08:53 +0200 Subject: cli: remove accents in image name Remove accents in the --name argument of the create image command. --- cli/utils.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cli/utils.py') diff --git a/cli/utils.py b/cli/utils.py index 9831d4b..3825583 100644 --- a/cli/utils.py +++ b/cli/utils.py @@ -5,6 +5,7 @@ # Free Software Foundation; either version 3 of the License, or # (at your option) any later version. +import unicodedata import json import ipaddress import re @@ -65,3 +66,6 @@ def check_mac_address(addr): print(addr.lower()) return False +def remove_accents(text): + normalized_text = unicodedata.normalize('NFD', text) + return ''.join(c for c in normalized_text if unicodedata.category(c) != 'Mn') -- cgit v1.2.3-18-g5258