Skip to content

Commit

Permalink
fix: use raw strings for regex parameter in get_string_input (#612)
Browse files Browse the repository at this point in the history
fixes #602

Signed-off-by: Dominik Willner <[email protected]>
  • Loading branch information
dw-0 authored Jan 3, 2025
1 parent 4ae5a37 commit 3852464
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions kiauh/core/menus/settings_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion kiauh/procedures/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ...")
Expand Down

0 comments on commit 3852464

Please sign in to comment.