UI Improvements
This commit is contained in:
+13
-28
@@ -21,12 +21,12 @@ import re
|
||||
import subprocess
|
||||
import tempfile
|
||||
import tkinter as tk
|
||||
from tkinter import filedialog, messagebox, simpledialog
|
||||
from utils.configmanager import load_env
|
||||
|
||||
from tkinter import filedialog
|
||||
|
||||
import pandas as pd
|
||||
|
||||
from utils.configmanager import load_env
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -98,32 +98,17 @@ def choose_file(initial_directory=None, required_substring=None):
|
||||
return file_path
|
||||
|
||||
|
||||
def choose_save_location():
|
||||
root = tk.Tk()
|
||||
root.withdraw()
|
||||
save_path = filedialog.asksaveasfilename(defaultextension=".txt")
|
||||
return save_path
|
||||
|
||||
|
||||
def ask_user_input(message):
|
||||
root = tk.Tk()
|
||||
root.withdraw()
|
||||
user_input = simpledialog.askstring("Input", "{message}]:")
|
||||
return user_input
|
||||
|
||||
|
||||
def show_info_message_cli(title, message):
|
||||
root = tk.Tk()
|
||||
root.withdraw()
|
||||
root.after(100, lambda: messagebox.showinfo(title, message))
|
||||
root.mainloop()
|
||||
|
||||
|
||||
def show_confirm_question():
|
||||
root = tk.Tk()
|
||||
root.withdraw()
|
||||
response = messagebox.askquestion("Confirm", "Do you want to continue?")
|
||||
print("User response:", response)
|
||||
def get_sanitized_input(prompt: str) -> str:
|
||||
while True:
|
||||
user_input = input(prompt)
|
||||
if user_input.strip() == "":
|
||||
return user_input # Allow blank lines
|
||||
if re.match(r'^[a-zA-Z0-9_\- .]+$', user_input.strip()):
|
||||
return user_input
|
||||
else:
|
||||
print("Invalid input. Only letters, numbers, underscores, spaces, hyphens, and periods are allowed.")
|
||||
|
||||
|
||||
def regulator(paths, case_insensitive=True):
|
||||
@@ -565,7 +550,7 @@ def printDeviceEnforceChecklist():
|
||||
)
|
||||
)
|
||||
|
||||
print(colorText("Q. Quit", "cyan"))
|
||||
print(colorText("B. Back", "cyan"))
|
||||
|
||||
|
||||
def colorText(text, color):
|
||||
|
||||
Reference in New Issue
Block a user