some formation adjustment
This commit is contained in:
parent
b3d72b2dc8
commit
cd62dd5312
2 changed files with 9 additions and 10 deletions
6
tui.py
6
tui.py
|
@ -44,13 +44,15 @@ class SimpleTUI:
|
||||||
|
|
||||||
def yes_no_menu(self, message): # oh
|
def yes_no_menu(self, message): # oh
|
||||||
menu_options = ["[y] yes", "[n] no"]
|
menu_options = ["[y] yes", "[n] no"]
|
||||||
menu = TerminalMenu(menu_entries = menu_options,
|
menu = TerminalMenu(
|
||||||
|
menu_entries = menu_options,
|
||||||
title = f"{message}",
|
title = f"{message}",
|
||||||
menu_cursor = "> ",
|
menu_cursor = "> ",
|
||||||
menu_cursor_style = ("fg_red", "bold"),
|
menu_cursor_style = ("fg_red", "bold"),
|
||||||
menu_highlight_style = ("bg_gray", "fg_black"),
|
menu_highlight_style = ("bg_gray", "fg_black"),
|
||||||
cycle_cursor = True,
|
cycle_cursor = True,
|
||||||
clear_screen = False)
|
clear_screen = False
|
||||||
|
)
|
||||||
menu_entry_index = menu.show()
|
menu_entry_index = menu.show()
|
||||||
if menu_entry_index == 0:
|
if menu_entry_index == 0:
|
||||||
return True
|
return True
|
||||||
|
|
|
@ -9,7 +9,6 @@ class Utilities:
|
||||||
with open(yaml_file, "r") as file:
|
with open(yaml_file, "r") as file:
|
||||||
data = yaml.safe_load(file)
|
data = yaml.safe_load(file)
|
||||||
return data
|
return data
|
||||||
|
|
||||||
except (FileNotFoundError, PermissionError) as e:
|
except (FileNotFoundError, PermissionError) as e:
|
||||||
print(f"Error loading settings file: {e}")
|
print(f"Error loading settings file: {e}")
|
||||||
return
|
return
|
||||||
|
@ -18,7 +17,6 @@ class Utilities:
|
||||||
try:
|
try:
|
||||||
with open(yaml_file, "w") as file:
|
with open(yaml_file, "w") as file:
|
||||||
yaml.dump(data, file)
|
yaml.dump(data, file)
|
||||||
|
|
||||||
except PermissionError as e:
|
except PermissionError as e:
|
||||||
print(f"Error saving setings: {e}")
|
print(f"Error saving setings: {e}")
|
||||||
|
|
||||||
|
@ -41,7 +39,6 @@ class Utilities:
|
||||||
progress = int((barsize / total) * current)
|
progress = int((barsize / total) * current)
|
||||||
rest = barsize - progress
|
rest = barsize - progress
|
||||||
if rest <= 2: rest = 0
|
if rest <= 2: rest = 0
|
||||||
|
|
||||||
# Determine the number of digits in total
|
# Determine the number of digits in total
|
||||||
total_digits = len(str(total))
|
total_digits = len(str(total))
|
||||||
# Format current with leading zeros
|
# Format current with leading zeros
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue