From a1de271e186a518932307bb7775f670d8ccd92f5 Mon Sep 17 00:00:00 2001 From: Botond Hende Date: Fri, 30 Aug 2024 20:25:37 +0200 Subject: changed import path to relative modul import paths --- __main__.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to '__main__.py') diff --git a/__main__.py b/__main__.py index 833bf72..9dba645 100644 --- a/__main__.py +++ b/__main__.py @@ -3,21 +3,21 @@ from typing import Annotated from fastapi import FastAPI, Depends -import apirouters.agents -import modules.database +from .apirouters import agents +from .modules import database @asynccontextmanager async def lifespan(app: FastAPI): - modules.database.cursor.execute( + database.cursor.execute( "CREATE TABLE IF NOT EXISTS agents(primary_key INTEGER PRIMARY KEY, callsign TEXT NOT NULL UNIQUE, token_hash TEXT NOT NULL)") yield app = FastAPI(lifespan=lifespan) -app.include_router(apirouters.agents.router) +app.include_router(agents.router) @app.get("/{callsign}/tasks") -async def get_tasks(callsign: str, token: Annotated[str, Depends(apirouters.agents.oauth2_scheme)]): +async def get_tasks(callsign: str, token: Annotated[str, Depends(agents.oauth2_scheme)]): return f'{{"callsign": "{callsign}", "token": "{token}"}}' -- cgit v1.2.3-70-g09d2