enforce 4-letter short name

This commit is contained in:
pdxlocations
2025-01-29 11:40:23 -08:00
parent 5e4b28d47a
commit 5084eca388
+4 -1
View File
@@ -20,6 +20,9 @@ def get_user_input(prompt):
input_win.addstr(3, 2, "Enter value: ", get_color("settings_default"))
input_win.refresh()
# Check if "shortName" is in the prompt, and set max length accordingly
max_length = 4 if "shortName" in prompt else None
curses.curs_set(1)
user_input = ""
@@ -34,7 +37,7 @@ def get_user_input(prompt):
user_input = user_input[:-1]
input_win.addstr(3, 15, " " * (len(user_input) + 1), get_color("settings_default")) # Clear the line
input_win.addstr(3, 15, user_input, get_color("settings_default"))
else:
elif max_length is None or len(user_input) < max_length: # Enforce max length if applicable
user_input += chr(key)
input_win.addstr(3, 15, user_input, get_color("settings_default"))