This commit is contained in:
2025-03-03 14:26:13 +03:00
parent d9c74310c3
commit 459c16ec87
13 changed files with 157 additions and 72 deletions
+9
View File
@@ -0,0 +1,9 @@
import re
def set_description_message_pattern(pattern: str) -> None:
first_check = re.match(r'.*command.*', pattern)
second_check = re.match(r'.*{description}.*', pattern)
set_description_message_pattern('Invalid des{ommand}cription pattern')
View File
-29
View File
@@ -1,29 +0,0 @@
from pprint import pprint
from rich.console import Console
from argenta.router import Router
work_router: Router = Router(name='work')
settings_router: Router = Router(name='settings')
console = Console()
@work_router.command(command='a')
def command_help():
console.print('[bold red]command help [/bold red]')
@work_router.command(command='B', description='tester')
def command_start_solving():
console.print('[bold red]command start [/bold red]')
@settings_router.command(command='b')
def command_settings():
console.print('[bold red]command settings [/bold red]')
@work_router.unknown_command
def command_unknown_command(command):
console.print(f'[bold red]Unknown command: [/bold red]{command}')
-17
View File
@@ -1,17 +0,0 @@
from pprint import pprint
from tests.mock_default_app.handlers.routers import work_router, settings_router
from argenta.app.entity import App
app: App = App(ignore_command_register=False,
line_separate='\n-------------------------------\n')
def main():
app.include_router(work_router, is_main=True)
app.include_router(settings_router)
app.start_polling()
if __name__ == "__main__":
main()
-11
View File
@@ -1,11 +0,0 @@
import re
def set_description_message_pattern(pattern: str) -> None:
first_check = re.fullmatch(r'.*{commmand}.*', pattern)
second_check = re.fullmatch(r'.*{description}.*', pattern)
print(bool(first_check))
print(second_check)
set_description_message_pattern('Invalid des{command}cription pattern')