From aa0d4f95337fae9d1d1b245e94eef083dba4b93d Mon Sep 17 00:00:00 2001 From: sudosnok Date: Sat, 2 Apr 2022 15:13:05 +0100 Subject: [PATCH] Adjusted kwargs to actually make sense for usernames/tokens --- Github/main.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Github/main.py b/Github/main.py index b712335..9699888 100644 --- a/Github/main.py +++ b/Github/main.py @@ -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__()