remove "run" Interface method

This commit is contained in:
axolotle 2023-01-07 14:23:23 +01:00
parent c016f4b510
commit 87317cea66
2 changed files with 1 additions and 15 deletions

View file

@ -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

View file

@ -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)