remove tests for .gitignore

This commit is contained in:
2025-02-08 22:42:35 +03:00
parent 6174de3bc0
commit 213525915d
22 changed files with 382 additions and 2 deletions
View File
@@ -0,0 +1,10 @@
from rich.console import Console
console = Console()
def help_command():
console.print("[italic bold]The main functionality of the script is to convert an expression from a string "
"to a mathematical one and then calculate this expression. "
"Project GitHub: https://github.com/koloideal/WordMath[/italic bold]")
@@ -0,0 +1,20 @@
from rich.console import Console
from ...business_logic.word2num_math import word2num_math
console = Console()
print_line_separator = lambda: console.print('\n[bold blue]--------------------------------------[/bold blue]\n')
def start_solving_command():
while True:
console.print(
"\n[italic]Enter a string expression or [bold italic green] Q [/bold italic green] for exit:[/italic]")
string_expression = input()
if string_expression.lower() == 'q':
break
else:
print_line_separator()
console.print(
f'[bold green]Answer:[/bold green] [bold blue]{word2num_math(string_expression)}[/bold blue]')
print_line_separator()
@@ -0,0 +1,26 @@
import requests
from rich.console import Console
from ...business_logic.script_updater import UpdateScript
console = Console()
print_line_separator = lambda: console.print('\n[bold green]--------------------------------------[/bold green]\n')
def upgrade_command():
try:
requests.get('https://ya.ru')
except requests.exceptions.ConnectionError:
console.print('[bold red]No internet connection[/bold red]')
else:
latest_tag = UpdateScript.start_update()
if latest_tag:
print_line_separator()
console.print(f"[bold yellow]The newest version ({latest_tag}) of the script has been successfully installed![/bold yellow]")
print_line_separator()
console.print("[bold yellow]Rerun the script for the changes to take effect[/bold yellow]")
print_line_separator()
exit(0)
else:
console.print('[bold red]You have the latest version installed[/bold red]')
+34
View File
@@ -0,0 +1,34 @@
from rich.console import Console
from argenta.router import Router
from ..handlers.handlers_implementation.help_command import help_command
from ..handlers.handlers_implementation.solving_command import start_solving_command
from ..handlers.handlers_implementation.upgrade_command import upgrade_command
work_router: Router = Router(name='Work points:',
ignore_command_register=False)
settings_router: Router = Router(name='Settings points:',
ignore_command_register=True)
console = Console()
@work_router.command(command='0', description='Get Help')
def command_help():
help_command()
@work_router.command(command='1', description='Start Solving')
def command_start_solving():
start_solving_command()
@settings_router.command(command='U', description='Update WordMath')
def command_update():
upgrade_command()
@work_router.unknown_command
def command_unknown_command(command):
console.print(f'[bold red]Unknown command: [/bold red]{command}')