mirror of
https://github.com/koloideal/Argenta.git
synced 2026-06-10 18:15:28 +03:00
ref: typehints, enum instead of raw string, abc and other (#1)
Full code coverage with annotations, fixing errors in various linters: ruff, wps, etc. Fixing errors in type checkers: ty, mypy, pyright. Formatting and bringing code to a consistent style, applying best practices in various aspects.
This commit is contained in:
+10
-24
@@ -1,39 +1,25 @@
|
||||
from rich.console import Console
|
||||
|
||||
from argenta.command import Command
|
||||
from argenta.command.flag.defaults import PredefinedFlags
|
||||
from argenta.command.flag import Flags, Flag, PossibleValues
|
||||
from argenta.command import Command, PredefinedFlags, Flags, Flag, PossibleValues
|
||||
from argenta.response import Response
|
||||
from argenta.router import Router
|
||||
from argenta import Router
|
||||
|
||||
|
||||
work_router: Router = Router(title="Work points:", disable_redirect_stdout=True)
|
||||
work_router: Router = Router(title="Work points:")
|
||||
|
||||
console = Console()
|
||||
|
||||
flag = Flag('csdv', possible_values=PossibleValues.DISABLE)
|
||||
flag = Flag('csdv', possible_values=PossibleValues.NEITHER)
|
||||
|
||||
|
||||
@work_router.command(
|
||||
Command(
|
||||
"get",
|
||||
"Get Help",
|
||||
Command("get",
|
||||
description="Get Help",
|
||||
aliases=["help", "Get_help"],
|
||||
flags=Flags(PredefinedFlags.PORT, PredefinedFlags.HOST),
|
||||
)
|
||||
)
|
||||
flags=Flags([PredefinedFlags.PORT,
|
||||
PredefinedFlags.HOST])))
|
||||
def command_help(response: Response):
|
||||
case = input("test > ")
|
||||
print(case)
|
||||
print(response.status)
|
||||
print(response.undefined_flags.get_flags())
|
||||
print(response.valid_flags.get_flags())
|
||||
print(response.invalid_value_flags.get_flags())
|
||||
print(response.input_flags.flags)
|
||||
|
||||
|
||||
@work_router.command("run")
|
||||
def command_start_solving(response: Response):
|
||||
print(response.status)
|
||||
print(response.undefined_flags.get_flags())
|
||||
print(response.valid_flags.get_flags())
|
||||
print(response.invalid_value_flags.get_flags())
|
||||
print(response.input_flags.flags)
|
||||
|
||||
Reference in New Issue
Block a user