extend arguments

This commit is contained in:
2025-10-11 18:29:11 +03:00
parent 0a1d462090
commit e481ee8775
13 changed files with 245 additions and 101 deletions
+7 -7
View File
@@ -3,14 +3,17 @@ from argenta.orchestrator.argparser import ArgParser
from argenta.orchestrator.argparser.entity import ArgSpace
DEFAULT_ARGPARSER: ArgParser = ArgParser(processed_args=[])
class Orchestrator:
def __init__(self, arg_parser: ArgParser | None = None):
def __init__(self, arg_parser: ArgParser = DEFAULT_ARGPARSER):
"""
Public. An orchestrator and configurator that defines the behavior of an integrated system, one level higher than the App
:param arg_parser: Cmd argument parser and configurator at startup
:return: None
"""
self._arg_parser: ArgParser | None = arg_parser
self._arg_parser: ArgParser = arg_parser
def start_polling(self, app: App) -> None:
"""
@@ -18,8 +21,5 @@ class Orchestrator:
:param app: a running application
:return: None
"""
if self._arg_parser is not None:
parsed_argspace: ArgSpace = self._arg_parser.parse_args()
app.run_polling(argspace=parsed_argspace)
else:
app.run_polling(argspace=None)
parsed_argspace: ArgSpace = self._arg_parser.parse_args()
app.run_polling(argspace=parsed_argspace)