use Path in type annotations oat 2

This commit is contained in:
Justus Kuhlmann 2026-03-23 13:06:12 +01:00
commit 97e30fa27d
Signed by: jkuhl
GPG key ID: 00ED992DD79B85A6

View file

@ -1,6 +1,7 @@
import os import os
from configparser import ConfigParser from configparser import ConfigParser
from typing import Any from typing import Any
from pathlib import Path
CONFIG_FILENAME = ".corrlib" CONFIG_FILENAME = ".corrlib"
cached: bool = True cached: bool = True
@ -73,7 +74,7 @@ def k2m(k: float) -> float:
return (1/(2*k))-4 return (1/(2*k))-4
def set_config(path: str, section: str, option: str, value: Any) -> None: def set_config(path: Path, section: str, option: str, value: Any) -> None:
""" """
Set configuration parameters for the library. Set configuration parameters for the library.
@ -100,7 +101,7 @@ def set_config(path: str, section: str, option: str, value: Any) -> None:
return return
def get_db_file(path: str) -> str: def get_db_file(path: Path) -> str:
""" """
Get the database file associated with the library at the given path. Get the database file associated with the library at the given path.
@ -122,7 +123,7 @@ def get_db_file(path: str) -> str:
return db_file return db_file
def cache_enabled(path: str) -> bool: def cache_enabled(path: Path) -> bool:
""" """
Check, whether the library is cached. Check, whether the library is cached.
Fallback is true. Fallback is true.