mirror of
https://github.com/koloideal/Argenta.git
synced 2026-06-10 18:15:28 +03:00
rename orchestrator method start_polling to run_repl
This commit is contained in:
@@ -3,11 +3,11 @@ from typer import Typer
|
||||
from .commands import run_handler, init_handler, new_handler
|
||||
|
||||
|
||||
def main():
|
||||
def main() -> None:
|
||||
app = Typer()
|
||||
app.command("run")(run_handler)
|
||||
app.command("init")(init_handler)
|
||||
app.command("new")(new_handler)
|
||||
app.command("run", help='Command to start the orchestrator repl; the path to the orchestrator is required')(run_handler)
|
||||
app.command("init", help="Creates a flat/src boilerplate architecture in an existing project")(init_handler)
|
||||
app.command("new", help="Creates a project and in it flat/src boilerplate architecture")(new_handler)
|
||||
app()
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
@@ -22,7 +22,7 @@ def main():
|
||||
app.include_router(router)
|
||||
|
||||
orchestrator = Orchestrator()
|
||||
orchestrator.start_polling(app)
|
||||
orchestrator.run_repl(app)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -49,7 +49,7 @@ def main():
|
||||
app.include_router(router)
|
||||
|
||||
orchestrator = Orchestrator()
|
||||
orchestrator.start_polling(app)
|
||||
orchestrator.run_repl(app)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
@@ -24,7 +24,7 @@ def main():
|
||||
app.include_router(router)
|
||||
|
||||
orchestrator = Orchestrator()
|
||||
orchestrator.start_polling(app)
|
||||
orchestrator.run_repl(app)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -51,7 +51,7 @@ def main():
|
||||
app.include_router(router)
|
||||
|
||||
orchestrator = Orchestrator()
|
||||
orchestrator.start_polling(app)
|
||||
orchestrator.run_repl(app)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
@@ -144,7 +144,7 @@ class BaseApp(BehaviorHandlersSettersMixin):
|
||||
is_stdout_redirected_by_router=processing_router.is_redirect_stdout_disabled
|
||||
)
|
||||
|
||||
def _run_polling(self) -> None:
|
||||
def _run_repl(self) -> None:
|
||||
self._viewer.view_initial_message(self._initial_message)
|
||||
self._pre_cycle_setup()
|
||||
while True:
|
||||
|
||||
@@ -9,7 +9,6 @@ __all__ = [
|
||||
|
||||
from typing import Any, Protocol, TypeVar, Callable
|
||||
|
||||
from argenta.response import Response
|
||||
|
||||
T = TypeVar("T", contravariant=True)
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ class Orchestrator:
|
||||
if self._arg_parser is not None:
|
||||
self._arg_parser._parse_args()
|
||||
|
||||
def start_polling(self, app: App) -> None:
|
||||
def run_repl(self, app: App) -> None:
|
||||
"""
|
||||
Public. Starting the user input processing cycle
|
||||
:param app: a running application
|
||||
@@ -41,4 +41,4 @@ class Orchestrator:
|
||||
)
|
||||
setup_dishka(app, container, auto_inject=self._auto_inject_handlers)
|
||||
|
||||
app._run_polling()
|
||||
app._run_repl()
|
||||
|
||||
Reference in New Issue
Block a user