mirror of
https://github.com/koloideal/Argenta.git
synced 2026-06-10 10:05:28 +03:00
extend arguments
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user