mirror of
https://github.com/RGBCube/GitHubWrapper
synced 2025-05-19 07:25:09 +00:00
Fix repr and bump version
This commit is contained in:
parent
c13448cf7d
commit
e34d67b581
4 changed files with 19 additions and 12 deletions
|
@ -1,5 +1,6 @@
|
|||
#== main.py ==#
|
||||
from __future__ import annotations
|
||||
from datetime import datetime
|
||||
|
||||
__all__ = (
|
||||
'GHClient',
|
||||
|
@ -15,6 +16,7 @@ from . import exceptions
|
|||
from .cache import RepoCache, UserCache
|
||||
from .http import http
|
||||
from .objects import Gist, Issue, Organization, Repository, User, File
|
||||
from Github.urls import BASE_URL
|
||||
|
||||
|
||||
class GHClient:
|
||||
|
@ -105,6 +107,12 @@ class GHClient:
|
|||
return wrapped
|
||||
return wrapper
|
||||
|
||||
async def latency(self) -> int:
|
||||
"""Returns the latency of the client."""
|
||||
start = datetime.utcnow()
|
||||
await self.http.session.get(BASE_URL + '/zen')
|
||||
return (datetime.utcnow() - start).total_seconds()
|
||||
|
||||
#@_cache(type='User')
|
||||
async def get_self(self) -> User:
|
||||
"""Returns the authenticated User object."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue