mirror of
https://github.com/koloideal/Argenta.git
synced 2026-06-10 10:05:28 +03:00
fix ovelapping with argparser
This commit is contained in:
@@ -3,12 +3,13 @@ from prompt_toolkit import HTML
|
|||||||
from argenta import App, Orchestrator
|
from argenta import App, Orchestrator
|
||||||
from argenta.app import PredefinedMessages, StaticDividingLine, AutoCompleter
|
from argenta.app import PredefinedMessages, StaticDividingLine, AutoCompleter
|
||||||
from argenta.app.dividing_line.models import DynamicDividingLine
|
from argenta.app.dividing_line.models import DynamicDividingLine
|
||||||
|
from argenta.orchestrator import ArgParser
|
||||||
from mock.mock_app.routers import work_router
|
from mock.mock_app.routers import work_router
|
||||||
|
|
||||||
app: App = App(
|
app: App = App(
|
||||||
dividing_line=StaticDividingLine('~')
|
dividing_line=StaticDividingLine('~')
|
||||||
)
|
)
|
||||||
orchestrator: Orchestrator = Orchestrator()
|
orchestrator: Orchestrator = Orchestrator(arg_parser=ArgParser(processed_args=[]))
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
__all__ = ["run_handler"]
|
__all__ = ["run_handler"]
|
||||||
|
|
||||||
import importlib
|
import importlib
|
||||||
|
import os
|
||||||
import sys
|
import sys
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Any
|
from typing import Any
|
||||||
@@ -33,6 +34,8 @@ def import_from_string(import_str: str) -> Any:
|
|||||||
|
|
||||||
|
|
||||||
def run_handler(entry_point: str) -> None:
|
def run_handler(entry_point: str) -> None:
|
||||||
|
os.environ["RUN_AS_ARGENTA_APPLICATION"] = "1"
|
||||||
|
|
||||||
if str(Path.cwd()) not in sys.path:
|
if str(Path.cwd()) not in sys.path:
|
||||||
sys.path.insert(0, str(Path.cwd()))
|
sys.path.insert(0, str(Path.cwd()))
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
__all__ = ["Orchestrator"]
|
__all__ = ["Orchestrator"]
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
from dishka import Provider, make_container
|
from dishka import Provider, make_container
|
||||||
|
|
||||||
from argenta.app import App
|
from argenta.app import App
|
||||||
@@ -7,7 +9,6 @@ from argenta.di.integration import setup_dishka
|
|||||||
from argenta.di.providers import SystemProvider
|
from argenta.di.providers import SystemProvider
|
||||||
from argenta.orchestrator.argparser import ArgParser
|
from argenta.orchestrator.argparser import ArgParser
|
||||||
|
|
||||||
DEFAULT_ARGPARSER: ArgParser = ArgParser(processed_args=[])
|
|
||||||
|
|
||||||
|
|
||||||
class Orchestrator:
|
class Orchestrator:
|
||||||
@@ -22,7 +23,7 @@ class Orchestrator:
|
|||||||
:param arg_parser: Cmd argument parser and configurator at startup
|
:param arg_parser: Cmd argument parser and configurator at startup
|
||||||
:return: None
|
:return: None
|
||||||
"""
|
"""
|
||||||
self._arg_parser: ArgParser | None = arg_parser
|
self._arg_parser: ArgParser | None = arg_parser if not os.getenv('RUN_AS_ARGENTA_APPLICATION') else None
|
||||||
self._custom_providers: list[Provider] = custom_providers or []
|
self._custom_providers: list[Provider] = custom_providers or []
|
||||||
self._auto_inject_handlers: bool = auto_inject_handlers
|
self._auto_inject_handlers: bool = auto_inject_handlers
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user