From 0d1d902d313770c58824e9a6f42f648e048f8fd1 Mon Sep 17 00:00:00 2001 From: NextChai <75498301+NextChai@users.noreply.github.com> Date: Mon, 19 Jul 2021 15:14:26 -0400 Subject: [PATCH 1/3] Forgot two ** --- tixte/http.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tixte/http.py b/tixte/http.py index cc4438c..f315f72 100644 --- a/tixte/http.py +++ b/tixte/http.py @@ -49,7 +49,7 @@ def __init__(self, session: Optional[aiohttp.ClientSession] = None) -> None: async def request(self, route: Route, **kwargs: Any) -> Dict: - async with self.session.request(route.method, route.url, {**route.parameters, **kwargs}) as resp: + async with self.session.request(route.method, route.url, **{**route.parameters, **kwargs}) as resp: if resp.status != 200: raise NotImplementedError("API status was not 200, this hasn't been implemented yet.") From 603b5c7ff867cb90fe0a1ac210200c6b072a1883 Mon Sep 17 00:00:00 2001 From: NextChai <75498301+NextChai@users.noreply.github.com> Date: Mon, 19 Jul 2021 15:19:40 -0400 Subject: [PATCH 2/3] Update how kwargs are handled with url params Was missing `**` in the initial commit, fixed to be nicer. I would ultimately like to format the params onto the url to be all one str, but I'm thinkin about the best way to do that, and will change it later. --- tixte/http.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tixte/http.py b/tixte/http.py index f315f72..661a749 100644 --- a/tixte/http.py +++ b/tixte/http.py @@ -49,11 +49,11 @@ def __init__(self, session: Optional[aiohttp.ClientSession] = None) -> None: async def request(self, route: Route, **kwargs: Any) -> Dict: - async with self.session.request(route.method, route.url, **{**route.parameters, **kwargs}) as resp: + kwargs = {**route.parameters, **kwargs} + async with self.session.request(route.method, route.url, **kwargs) as resp: if resp.status != 200: raise NotImplementedError("API status was not 200, this hasn't been implemented yet.") # We're going to assume the API returns Dict for now. # We'll change this later as I get more info. - return await resp.json() - \ No newline at end of file + return await resp.json() \ No newline at end of file From 026532488e33a6e21e8542e659be0f964ee38b4d Mon Sep 17 00:00:00 2001 From: NextChai <75498301+NextChai@users.noreply.github.com> Date: Mon, 19 Jul 2021 15:24:41 -0400 Subject: [PATCH 3/3] Remove comments, api returns json --- tixte/http.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tixte/http.py b/tixte/http.py index 661a749..b6df921 100644 --- a/tixte/http.py +++ b/tixte/http.py @@ -53,7 +53,5 @@ async def request(self, route: Route, **kwargs: Any) -> Dict: async with self.session.request(route.method, route.url, **kwargs) as resp: if resp.status != 200: raise NotImplementedError("API status was not 200, this hasn't been implemented yet.") - - # We're going to assume the API returns Dict for now. - # We'll change this later as I get more info. + return await resp.json() \ No newline at end of file