1
Fork 0
mirror of https://github.com/RGBCube/GitHubWrapper synced 2025-05-18 06:55:09 +00:00

Objects werent cached properly, fixed with kwargs

This commit is contained in:
sudosnok 2022-04-07 19:24:44 +01:00
parent 9944f5ac27
commit e0623fe367

View file

@ -106,16 +106,16 @@ class GHClient:
raise exceptions.NoAuthProvided raise exceptions.NoAuthProvided
@_cache(type='User') @_cache(type='User')
async def get_user(self, username: str) -> User: async def get_user(self, *, user: str) -> User:
"""Fetch a Github user from their username.""" """Fetch a Github user from their username."""
return User(await self.http.get_user(username), self.http.session) return User(await self.http.get_user(user), self.http.session)
@_cache(type='Repo') @_cache(type='Repo')
async def get_repo(self, owner: str, repo: str) -> Repository: async def get_repo(self, *, owner: str, repo: str) -> Repository:
"""Fetch a Github repository from it's name.""" """Fetch a Github repository from it's name."""
return Repository(await self.http.get_repo(owner, repo), self.http.session) return Repository(await self.http.get_repo(owner, repo), self.http.session)
async def get_issue(self, owner: str, repo: str, issue: int) -> Issue: async def get_issue(self, *, owner: str, repo: str, issue: int) -> Issue:
"""Fetch a Github repository from it's name.""" """Fetch a Github repository from it's name."""
return Issue(await self.http.get_repo_issue(owner, repo, issue), self.http.session) return Issue(await self.http.get_repo_issue(owner, repo, issue), self.http.session)