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

Use class classmeth instead of http

This commit is contained in:
VarMonke 2022-03-28 19:43:16 +05:30
parent 04a1eecec8
commit 82c8bf06ac

View file

@ -77,11 +77,11 @@ class GHClient:
async def get_user(self, username: str) -> User: async def get_user(self, username: str) -> User:
"""Fetch a Github user from their username.""" """Fetch a Github user from their username."""
return User(await http.get_user(self.session, username), self.session) return User.get_user(self.session, username)
async def get_repo(self, owner: str, repo_name: str) -> Repository: async def get_repo(self, owner: str, repo_name: str) -> Repository:
"""Fetch a Github repository from it's name.""" """Fetch a Github repository from it's name."""
return Repository(await http.get_repo_from_name(self.session, owner, repo_name), self.session) return Repository.from_name(self.session, owner, repo_name)
async def get_org(self, org_name: str) -> 'Org': async def get_org(self, org_name: str) -> 'Org':
"""Fetch a Github organization from it's name""" """Fetch a Github organization from it's name"""