started implementing menu in python instead
This commit is contained in:
parent
aa893d800a
commit
fbac02d6f9
3 changed files with 27 additions and 1 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1 +1 @@
|
|||
node_modules/
|
||||
__pycache__/
|
||||
|
|
4
main.py
Normal file
4
main.py
Normal file
|
@ -0,0 +1,4 @@
|
|||
from menu import Menu
|
||||
from icecream import ic
|
||||
|
||||
ic(Menu)
|
22
menu.py
Normal file
22
menu.py
Normal 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)]
|
Reference in a new issue