mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-27 01:33:36 +05:00
refactor: extend firmware flashing functionalities
Signed-off-by: Dominik Willner <th33xitus@gmail.com>
This commit is contained in:
@@ -14,12 +14,14 @@ class FooterType(Enum):
|
||||
QUIT = "QUIT"
|
||||
BACK = "BACK"
|
||||
BACK_HELP = "BACK_HELP"
|
||||
BLANK = "BLANK"
|
||||
|
||||
|
||||
NAVI_OPTIONS = {
|
||||
FooterType.QUIT: ["q"],
|
||||
FooterType.BACK: ["b"],
|
||||
FooterType.BACK_HELP: ["b", "h"],
|
||||
FooterType.BLANK: [],
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -19,10 +19,12 @@ from utils.constants import COLOR_YELLOW, RESET_FORMAT
|
||||
|
||||
# noinspection PyUnusedLocal
|
||||
class AdvancedMenu(BaseMenu):
|
||||
def __init__(self, previous_menu: BaseMenu):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
|
||||
self.previous_menu: BaseMenu = previous_menu
|
||||
from core.menus.main_menu import MainMenu
|
||||
|
||||
self.previous_menu: BaseMenu = MainMenu()
|
||||
self.options = {
|
||||
"1": None,
|
||||
"2": None,
|
||||
|
||||
@@ -92,6 +92,10 @@ def print_back_help_footer():
|
||||
print(footer, end="")
|
||||
|
||||
|
||||
def print_blank_footer():
|
||||
print("\=======================================================/")
|
||||
|
||||
|
||||
Options = Dict[str, Callable]
|
||||
|
||||
|
||||
@@ -119,6 +123,8 @@ class BaseMenu(ABC):
|
||||
print_back_footer()
|
||||
elif self.footer_type is FooterType.BACK_HELP:
|
||||
print_back_help_footer()
|
||||
elif self.footer_type is FooterType.BLANK:
|
||||
print_blank_footer()
|
||||
else:
|
||||
raise NotImplementedError("Method for printing footer not implemented.")
|
||||
|
||||
|
||||
@@ -152,7 +152,7 @@ class MainMenu(BaseMenu):
|
||||
RemoveMenu(previous_menu=self).run()
|
||||
|
||||
def advanced_menu(self, **kwargs):
|
||||
AdvancedMenu(previous_menu=self).run()
|
||||
AdvancedMenu().run()
|
||||
|
||||
def backup_menu(self, **kwargs):
|
||||
BackupMenu(previous_menu=self).run()
|
||||
|
||||
Reference in New Issue
Block a user