From 43ff3fd15fd58b22eba931cfd90a7120edbd9faa Mon Sep 17 00:00:00 2001 From: wizzdom Date: Thu, 16 Jan 2025 15:45:10 +0000 Subject: [PATCH] fix types --- src/utils.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/utils.py b/src/utils.py index 1205583..cff8b65 100644 --- a/src/utils.py +++ b/src/utils.py @@ -28,9 +28,7 @@ async def hedgedoc_login(aiohttp_client: aiohttp.ClientSession) -> None: await aiohttp_client.post("https://md.redbrick.dcu.ie/auth/ldap", data=data) -async def get_md_content( - url: str, aiohttp_client: aiohttp.ClientSession -) -> str | tuple[str, urlparse]: +async def get_md_content(url: str, aiohttp_client: aiohttp.ClientSession) -> str: """ Get the content of a note at a HedgeDoc URL. """ @@ -51,7 +49,7 @@ async def get_md_content( async def post_new_md_content( content: str, aiohttp_client: aiohttp.ClientSession -) -> str: +) -> str | None: post_url = "https://md.redbrick.dcu.ie/new" post_headers = {"Content-Type": "text/markdown"} @@ -66,8 +64,8 @@ async def post_new_md_content( ) return None - return await response.url + return str(response.url) + def utcnow() -> datetime.datetime: return datetime.datetime.now(datetime.timezone.utc) -