From 3170313734b6d383750bd97797ac737c07aa8141 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= <40151420+ldericher@users.noreply.github.com> Date: Wed, 7 Sep 2022 00:29:32 +0000 Subject: [PATCH] only "from"-imports --- api/ovdashboard_api/__init__.py | 4 ++-- api/ovdashboard_api/dav_calendar.py | 4 ++-- api/ovdashboard_api/dav_file.py | 4 ++-- api/ovdashboard_api/main.py | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/api/ovdashboard_api/__init__.py b/api/ovdashboard_api/__init__.py index ae8c6e6..038ce7a 100644 --- a/api/ovdashboard_api/__init__.py +++ b/api/ovdashboard_api/__init__.py @@ -5,7 +5,7 @@ Package `ovdashboard_api`: Contains the API powering the This file: Sets up logging. """ -import logging.config +from logging.config import dictConfig from pydantic import BaseModel @@ -43,4 +43,4 @@ class LogConfig(BaseModel): } -logging.config.dictConfig(LogConfig().dict()) +dictConfig(LogConfig().dict()) diff --git a/api/ovdashboard_api/dav_calendar.py b/api/ovdashboard_api/dav_calendar.py index 6a8299d..98bd885 100644 --- a/api/ovdashboard_api/dav_calendar.py +++ b/api/ovdashboard_api/dav_calendar.py @@ -4,10 +4,10 @@ Definition of an asyncio compatible CalDAV calendar. Caches events using `timed_alru_cache`. """ -import logging from dataclasses import dataclass from datetime import datetime, timedelta from functools import total_ordering +from logging import getLogger from typing import Iterator from caldav import Calendar @@ -20,7 +20,7 @@ from .config import Config from .dav_common import caldav_principal from .settings import SETTINGS -_logger = logging.getLogger(__name__) +_logger = getLogger(__name__) def _string_strip(in_str: str) -> str: diff --git a/api/ovdashboard_api/dav_file.py b/api/ovdashboard_api/dav_file.py index 6c13f38..ca914fb 100644 --- a/api/ovdashboard_api/dav_file.py +++ b/api/ovdashboard_api/dav_file.py @@ -4,9 +4,9 @@ Definition of an asyncio compatible WebDAV file. Caches files using `timed_alru_cache`. """ -import logging from dataclasses import dataclass from io import BytesIO +from logging import getLogger from typing import Any from webdav3.client import Resource @@ -15,7 +15,7 @@ from .async_helpers import get_ttl_hash, run_in_executor, timed_alru_cache from .dav_common import webdav_resource from .settings import SETTINGS -_logger = logging.getLogger(__name__) +_logger = getLogger(__name__) @timed_alru_cache(maxsize=SETTINGS.cache_size) diff --git a/api/ovdashboard_api/main.py b/api/ovdashboard_api/main.py index 67a0c51..ad909d1 100644 --- a/api/ovdashboard_api/main.py +++ b/api/ovdashboard_api/main.py @@ -6,8 +6,8 @@ Main script for `ovdashboard_api` module. Creates the main `FastAPI` app. """ -import uvicorn from fastapi import FastAPI +from uvicorn import run as uvicorn_run from .dav_common import webdav_check from .routers import main_router @@ -38,7 +38,7 @@ def main() -> None: """ if webdav_check(): - uvicorn.run( + uvicorn_run( app="ovdashboard_api.main:app", host="0.0.0.0", port=8000,