mirror of
https://github.com/koloideal/Argenta.git
synced 2026-06-10 10:05:28 +03:00
add Enum PossibleValues for bool values as values of possible_values argument in Flag
This commit is contained in:
+9
-18
@@ -1,22 +1,13 @@
|
||||
from argenta.router import Router
|
||||
from argenta.command import Command
|
||||
from argenta.response import Response
|
||||
from argenta.metrics import get_time_of_pre_cycle_setup
|
||||
from argenta.response.status import Status
|
||||
from argenta.command.flag import Flag, Flags
|
||||
from argenta.app import App
|
||||
from argenta.orchestrator import Orchestrator
|
||||
from enum import Enum
|
||||
from typing import Literal
|
||||
|
||||
|
||||
router = Router()
|
||||
class PossibleValues(Enum):
|
||||
DISABLE: Literal[False] = False
|
||||
ALL: Literal[True] = True
|
||||
|
||||
def __eq__(self, other: bool) -> bool:
|
||||
return self.value == other
|
||||
|
||||
|
||||
@router.command(Command("case are"))
|
||||
def handler(response: Response):
|
||||
print(response.status)
|
||||
|
||||
|
||||
app = App(repeat_command_groups=False)
|
||||
app.include_router(router)
|
||||
|
||||
app.run_polling()
|
||||
print(PossibleValues.DISABLE == False)
|
||||
|
||||
Reference in New Issue
Block a user