From 3852464ab7af2e1b880ad9c62060ee26968e7197 Mon Sep 17 00:00:00 2001 From: dw-0 Date: Fri, 3 Jan 2025 22:10:39 +0100 Subject: [PATCH] fix: use raw strings for regex parameter in get_string_input (#612) fixes #602 Signed-off-by: Dominik Willner --- kiauh/core/menus/settings_menu.py | 6 ++---- kiauh/procedures/system.py | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/kiauh/core/menus/settings_menu.py b/kiauh/core/menus/settings_menu.py index 18232145..b0a9ffa9 100644 --- a/kiauh/core/menus/settings_menu.py +++ b/kiauh/core/menus/settings_menu.py @@ -21,9 +21,7 @@ from core.menus.base_menu import BaseMenu from core.settings.kiauh_settings import KiauhSettings, RepoSettings from core.types.color import Color -from core.types.component_status import ComponentStatus from procedures.switch_repo import run_switch_repo_routine -from utils.git_utils import get_repo_name from utils.input_utils import get_confirm, get_string_input @@ -141,12 +139,12 @@ def _gather_input(self, repo_name: Literal["klipper", "moonraker"], repo_dir: Pa repo = get_string_input( "Enter new repository URL", - regex="^[\w/.:-]+$", + regex=r"^[\w/.:-]+$", default=KLIPPER_REPO_URL if repo_name == "klipper" else MOONRAKER_REPO_URL, ) branch = get_string_input( "Enter new branch name", - regex="^.+$", + regex=r"^.+$", default="master" ) diff --git a/kiauh/procedures/system.py b/kiauh/procedures/system.py index 93bf0589..515054d8 100644 --- a/kiauh/procedures/system.py +++ b/kiauh/procedures/system.py @@ -51,7 +51,7 @@ def change_system_hostname() -> None: ) hostname = get_string_input( "Enter the new hostname", - regex="^[a-z0-9]+([a-z0-9-]*[a-z0-9])?$", + regex=r"^[a-z0-9]+([a-z0-9-]*[a-z0-9])?$", ) if not get_confirm(f"Change the hostname to '{hostname}'?", default_choice=False): Logger.print_info("Aborting hostname change ...")