mirror of
https://github.com/RGBCube/GitHubWrapper
synced 2025-05-20 07:55:09 +00:00
might fix?
This commit is contained in:
parent
a769769b77
commit
98545347b6
1 changed files with 8 additions and 8 deletions
|
@ -8,7 +8,7 @@ __all__ = (
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import functools
|
import functools
|
||||||
from typing import Union, List
|
from typing import Union, List, Dict
|
||||||
|
|
||||||
import aiohttp
|
import aiohttp
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ from . import exceptions
|
||||||
from .cache import RepoCache, UserCache
|
from .cache import RepoCache, UserCache
|
||||||
from .http import http
|
from .http import http
|
||||||
from .objects import Gist, Issue, Organization, Repository, User, File
|
from .objects import Gist, Issue, Organization, Repository, User, File
|
||||||
from Github.urls import BASE_URL
|
from .urls import BASE_URL
|
||||||
|
|
||||||
|
|
||||||
class GHClient:
|
class GHClient:
|
||||||
|
@ -107,12 +107,6 @@ class GHClient:
|
||||||
return wrapped
|
return wrapped
|
||||||
return wrapper
|
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')
|
#@_cache(type='User')
|
||||||
async def get_self(self) -> User:
|
async def get_self(self) -> User:
|
||||||
"""Returns the authenticated User object."""
|
"""Returns the authenticated User object."""
|
||||||
|
@ -159,5 +153,11 @@ class GHClient:
|
||||||
"""Fetch a Github organization from it's name."""
|
"""Fetch a Github organization from it's name."""
|
||||||
return Organization(await self.http.get_org(org), self.http.session)
|
return Organization(await self.http.get_org(org), self.http.session)
|
||||||
|
|
||||||
|
async def latency(self) -> float:
|
||||||
|
"""Returns the latency of the client."""
|
||||||
|
start = datetime.utcnow()
|
||||||
|
await self.http.session.get(BASE_URL + '/zen')
|
||||||
|
return (datetime.utcnow() - start).total_seconds()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue