chore: Remformat code

This commit is contained in:
oSumAtrIX 2023-11-03 22:37:18 +01:00
parent 57db41441b
commit 16c7ca4668
No known key found for this signature in database
GPG Key ID: A9B3094ACDB604B4

View File

@ -2,10 +2,11 @@ from abc import abstractmethod
import asyncio
import aiohttp
class Api:
_api_key: str | None
_client_session = aiohttp.ClientSession()
_client_session = aiohttp.ClientSession()
@abstractmethod
def __init__(self, api_key: str | None = None):
@ -56,6 +57,7 @@ class Api:
"""
raise NotImplementedError
class GitHubApi(Api):
def __init__(self):
super().__init__()
@ -92,6 +94,7 @@ class GitHubApi(Api):
contributors.sort(key=sort_and_delete_key, reverse=True)
return contributors
# TODO: Return a list of objects instead of a dict.
async def get_release(
self, repository: str, all: bool = False, prerelease: bool = False
) -> dict | list:
@ -104,7 +107,6 @@ class GitHubApi(Api):
Returns:
dict: The transformed release dict.
"""
return {
# TODO: Check if theres any need for this: 'id': release['id'].
"tag": release["tag_name"],
@ -155,5 +157,3 @@ class GitHubApi(Api):
async def is_rate_limited(self) -> bool:
async with self._client_session.get('https://api.github.com/rate_limit') as resp:
return (await resp.json())["rate"]["remaining"] == 0