diff --git a/src/interface/api.py b/src/interface/api.py index 7ac893ce7..0131f5c24 100644 --- a/src/interface/api.py +++ b/src/interface/api.py @@ -4,7 +4,6 @@ import inspect import types import fastapi import pydantic -import uvicorn from typing import Optional, Union @@ -77,16 +76,6 @@ class Interface: interface.instance, prefix=f"/{interface.name}", tags=[interface.name] ) - def run(self, host="127.0.0.1", port=6787, debug=False, reload=False): - uvicorn.run( - self.instance, - host=host, - port=port, - log_level="info" if not debug else "debug", - reload=reload, - root_path="/yunohost/api", - ) - def cli(self, *args, **kwargs): def decorator(func): return func diff --git a/src/interface/cli.py b/src/interface/cli.py index b5f068d3c..e9c9f4687 100644 --- a/src/interface/cli.py +++ b/src/interface/cli.py @@ -11,7 +11,7 @@ from rich.syntax import Syntax def parse_cli_command(command: str) -> tuple[str, list[str]]: command, *args = command.split(" ") - return (command, [arg.strip("{}") for arg in args]) + return command, [arg.strip("{}") for arg in args] def print_as_yaml(data: Any): @@ -32,9 +32,6 @@ class Interface: def add(self, interface: Interface): self.instance.add_typer(interface.instance, name=interface.name) - def run(self): - self.instance() - def cli(self, command_def: str, **kwargs): def decorator(func): signature = inspect.signature(func)