1
Fork 0
mirror of https://github.com/RGBCube/GitHubWrapper synced 2025-05-17 22:45:08 +00:00

Adjusted kwargs to actually make sense for usernames/tokens

This commit is contained in:
sudosnok 2022-04-02 15:13:05 +01:00
parent fc3f3a7658
commit aa0d4f9533

View file

@ -20,15 +20,14 @@ class GHClient:
def __init__(
self,
*,
using_auth: bool = False,
username: str | None = None,
token: str | None = None,
custom_headers: dict[str, str | int] = {}
):
"""The main client, used to start most use-cases."""
self._headers = custom_headers
if using_auth:
username = input('Enter your username: ') #these two lines are blocking, but it's probably not a problem
auth_token = getpass('Enter your token: ')
self._auth = aiohttp.BasicAuth(username, auth_token)
if username and token:
self._auth = aiohttp.BasicAuth(username, token)
def __await__(self) -> 'GHClient':
return self.start().__await__()