started implementing menu in python instead
This commit is contained in:
parent
aa893d800a
commit
fbac02d6f9
|
@ -1 +1 @@
|
|||
node_modules/
|
||||
__pycache__/
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
from menu import Menu
|
||||
from icecream import ic
|
||||
|
||||
ic(Menu)
|
|
@ -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 New Issue