mirror of
https://github.com/flibusta-apps/telegram_files_server.git
synced 2025-12-06 20:45:37 +01:00
Add linters config
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
from fastapi import FastAPI
|
||||
|
||||
from core.db import database
|
||||
from app.on_start import on_start
|
||||
from app.views import router
|
||||
from core.db import database
|
||||
|
||||
|
||||
def start_app() -> FastAPI:
|
||||
@@ -12,7 +12,7 @@ def start_app() -> FastAPI:
|
||||
|
||||
app.include_router(router)
|
||||
|
||||
@app.on_event('startup')
|
||||
@app.on_event("startup")
|
||||
async def startup() -> None:
|
||||
database_ = app.state.database
|
||||
if not database_.is_connected:
|
||||
@@ -20,7 +20,7 @@ def start_app() -> FastAPI:
|
||||
|
||||
await on_start()
|
||||
|
||||
@app.on_event('shutdown')
|
||||
@app.on_event("shutdown")
|
||||
async def shutdown() -> None:
|
||||
database_ = app.state.database
|
||||
if database_.is_connected:
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from fastapi.security import APIKeyHeader
|
||||
from fastapi.security.utils import get_authorization_scheme_param
|
||||
|
||||
|
||||
default_security = APIKeyHeader(name="Authorization")
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel, BaseSettings
|
||||
|
||||
|
||||
BotToken = str
|
||||
TelethonSessionName= str
|
||||
TelethonSessionName = str
|
||||
|
||||
|
||||
class TelethonConfig(BaseModel):
|
||||
APP_ID: int
|
||||
@@ -27,8 +29,8 @@ class EnvConfig(BaseSettings):
|
||||
TELETHON_SESSIONS: Optional[list[TelethonSessionName]]
|
||||
|
||||
class Config:
|
||||
env_file = '.env'
|
||||
env_file_encoding = 'utf-8'
|
||||
env_file = ".env"
|
||||
env_file_encoding = "utf-8"
|
||||
|
||||
|
||||
env_config = EnvConfig()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from urllib.parse import quote
|
||||
from databases import Database
|
||||
|
||||
from databases import Database
|
||||
from sqlalchemy import MetaData
|
||||
|
||||
from core.config import env_config
|
||||
|
||||
Reference in New Issue
Block a user