use Path in type annotations oat 2
This commit is contained in:
parent
92f307b83a
commit
97e30fa27d
1 changed files with 4 additions and 3 deletions
|
|
@ -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.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue