started implementing menu in python instead

This commit is contained in:
Rudis Muiznieks 2022-04-23 10:08:56 -05:00
parent aa893d800a
commit fbac02d6f9
Signed by: rudism
GPG Key ID: CABF2F86EF7884F9
3 changed files with 27 additions and 1 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
node_modules/
__pycache__/

4
main.py Normal file
View File

@ -0,0 +1,4 @@
from menu import Menu
from icecream import ic
ic(Menu)

22
menu.py Normal file
View File

@ -0,0 +1,22 @@
from enum import Enum, auto
from dataclasses import dataclass
class MenuType(Enum):
SUB_MENU = auto()
EXEC_CMD = auto()
EXEC_PLUGIN = auto()
@dataclass
class MenuItem:
display: str
menu_type: MenuType
Menu = [
MenuItem("df -h",
MenuType.EXEC_CMD),
MenuItem("Chess",
MenuType.EXEC_PLUGIN),
MenuItem("Reboot",
MenuType.EXEC_CMD),
MenuItem("Shutdown",
MenuType.EXEC_CMD)]