mirror of
https://github.com/koloideal/Argenta.git
synced 2026-06-10 18:15:28 +03:00
some fix
This commit is contained in:
+15
-17
@@ -105,6 +105,15 @@ class AppPrinters(AppInit):
|
|||||||
self._print_func(self._dividing_line.get_full_line(max_length_line))
|
self._print_func(self._dividing_line.get_full_line(max_length_line))
|
||||||
|
|
||||||
|
|
||||||
|
def _print_framed_text(self, text: str):
|
||||||
|
if isinstance(self._dividing_line, StaticDividingLine):
|
||||||
|
self._print_func(self._dividing_line.get_full_line())
|
||||||
|
self._print_func(text)
|
||||||
|
self._print_func(self._dividing_line.get_full_line())
|
||||||
|
elif isinstance(self._dividing_line, DynamicDividingLine):
|
||||||
|
self._print_framed_text_with_dynamic_line(text)
|
||||||
|
|
||||||
|
|
||||||
class AppNonStandardHandlers(AppPrinters):
|
class AppNonStandardHandlers(AppPrinters):
|
||||||
def _is_exit_command(self, command: InputCommand):
|
def _is_exit_command(self, command: InputCommand):
|
||||||
if command.get_trigger().lower() == self._exit_command.get_trigger().lower():
|
if command.get_trigger().lower() == self._exit_command.get_trigger().lower():
|
||||||
@@ -218,15 +227,10 @@ class App(AppSetters, AppNonStandardHandlers, AppSetups):
|
|||||||
try:
|
try:
|
||||||
input_command: InputCommand = InputCommand.parse(raw_command=raw_command)
|
input_command: InputCommand = InputCommand.parse(raw_command=raw_command)
|
||||||
except BaseInputCommandException as error:
|
except BaseInputCommandException as error:
|
||||||
if isinstance(self._dividing_line, StaticDividingLine):
|
with redirect_stdout(io.StringIO()) as f:
|
||||||
self._print_func(self._dividing_line.get_full_line())
|
|
||||||
self._error_handler(error, raw_command)
|
self._error_handler(error, raw_command)
|
||||||
self._print_func(self._dividing_line.get_full_line())
|
res: str = f.getvalue()
|
||||||
elif isinstance(self._dividing_line, DynamicDividingLine):
|
self._print_framed_text(res)
|
||||||
with redirect_stdout(io.StringIO()) as f:
|
|
||||||
self._error_handler(error, raw_command)
|
|
||||||
res: str = f.getvalue()
|
|
||||||
self._print_framed_text_with_dynamic_line(res)
|
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if self._is_exit_command(input_command):
|
if self._is_exit_command(input_command):
|
||||||
@@ -236,17 +240,11 @@ class App(AppSetters, AppNonStandardHandlers, AppSetups):
|
|||||||
if self._is_unknown_command(input_command):
|
if self._is_unknown_command(input_command):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if isinstance(self._dividing_line, StaticDividingLine):
|
with redirect_stdout(io.StringIO()) as f:
|
||||||
self._print_func(self._dividing_line.get_full_line())
|
|
||||||
for registered_router in self._registered_routers:
|
for registered_router in self._registered_routers:
|
||||||
registered_router.input_command_handler(input_command)
|
registered_router.input_command_handler(input_command)
|
||||||
self._print_func(self._dividing_line.get_full_line())
|
res: str = f.getvalue()
|
||||||
elif isinstance(self._dividing_line, DynamicDividingLine):
|
self._print_framed_text(res)
|
||||||
with redirect_stdout(io.StringIO()) as f:
|
|
||||||
for registered_router in self._registered_routers:
|
|
||||||
registered_router.input_command_handler(input_command)
|
|
||||||
res: str = f.getvalue()
|
|
||||||
self._print_framed_text_with_dynamic_line(res)
|
|
||||||
|
|
||||||
if not self._repeat_command_groups_description:
|
if not self._repeat_command_groups_description:
|
||||||
self._print_func(self._prompt)
|
self._print_func(self._prompt)
|
||||||
|
|||||||
@@ -19,7 +19,9 @@ def command_help():
|
|||||||
help_command()
|
help_command()
|
||||||
|
|
||||||
|
|
||||||
@work_router.command(Command('start', 'Start Solving', Flags(PredeterminedFlags.HOST, PredeterminedFlags.PORT), aliases=['starting']))
|
@work_router.command(Command('start', 'Start Solving',
|
||||||
|
flags=Flags(PredeterminedFlags.HOST, PredeterminedFlags.PORT),
|
||||||
|
aliases=['starting']))
|
||||||
def command_start_solving(args: InputFlags):
|
def command_start_solving(args: InputFlags):
|
||||||
print(args.get_flag('host'))
|
print(args.get_flag('host'))
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "argenta"
|
name = "argenta"
|
||||||
version = "0.5.0-beta2"
|
version = "0.5.0"
|
||||||
description = "Python library for creating TUI"
|
description = "Python library for creating TUI"
|
||||||
authors = [
|
authors = [
|
||||||
{name = "kolo", email = "kolo.is.main@gmail.com"}
|
{name = "kolo", email = "kolo.is.main@gmail.com"}
|
||||||
|
|||||||
Reference in New Issue
Block a user