httpx -> aiohttp;

fixed sync Client
This commit is contained in:
2025-04-16 10:46:25 +03:00
parent b58a8f3ec6
commit d03f6deb24
9 changed files with 673 additions and 478 deletions
+1 -5
View File
@@ -1,13 +1,11 @@
from pathlib import Path
DEFAULT_HEADERS = {
"Accept": "application/json",
"Authorization": "OAuth {token}",
}
def generate_headers(token: str) -> dict:
headers = DEFAULT_HEADERS.copy()
@@ -17,7 +15,7 @@ def generate_headers(token: str) -> dict:
def parse_path(path: str, prefix: str = "disk:/") -> str:
path = str(Path(path)) # Some kind of check is path valid or not =P
path = str(Path(path)) # Some kind of check is path valid or not =P
if path.startswith("/"):
path = prefix + path[1:]
@@ -25,5 +23,3 @@ def parse_path(path: str, prefix: str = "disk:/") -> str:
path = prefix + path
return path