mirror of
https://github.com/dw-0/kiauh.git
synced 2026-03-23 02:48:35 +05:00
refactor: add regex pattern to assign custom names
Signed-off-by: Dominik Willner <th33xitus@gmail.com>
This commit is contained in:
@@ -141,8 +141,10 @@ def assign_custom_name(key: int, name_dict: Dict[int, str]) -> None:
|
||||
existing_names = []
|
||||
existing_names.extend(Klipper.blacklist())
|
||||
existing_names.extend(name_dict[n] for n in name_dict)
|
||||
pattern = r"^[a-zA-Z0-9]+$"
|
||||
|
||||
question = f"Enter name for instance {key + 1}"
|
||||
name_dict[key] = get_string_input(question, exclude=existing_names)
|
||||
name_dict[key] = get_string_input(question, exclude=existing_names, regex=pattern)
|
||||
|
||||
|
||||
def handle_to_multi_instance_conversion(new_name: str) -> None:
|
||||
|
||||
Reference in New Issue
Block a user