mirror of
https://github.com/RGBCube/GitHubWrapper
synced 2025-05-20 07:55:09 +00:00
Third times a charm
This commit is contained in:
parent
6797dc8a4f
commit
153e1e50d4
1 changed files with 3 additions and 3 deletions
|
@ -8,7 +8,7 @@ from getpass import getpass
|
||||||
import aiohttp
|
import aiohttp
|
||||||
|
|
||||||
import http
|
import http
|
||||||
from exceptions import AlreadyStarted, NotStarted
|
import exceptions
|
||||||
from objects import User, Repository
|
from objects import User, Repository
|
||||||
|
|
||||||
class Github:
|
class Github:
|
||||||
|
@ -35,7 +35,7 @@ class Github:
|
||||||
|
|
||||||
def check_limits(self, as_dict: bool = False) -> dict[str, str | int] | list[str]:
|
def check_limits(self, as_dict: bool = False) -> dict[str, str | int] | list[str]:
|
||||||
if not self.has_started:
|
if not self.has_started:
|
||||||
raise NotStarted
|
raise exceptions.NotStarted
|
||||||
if not as_dict:
|
if not as_dict:
|
||||||
output = []
|
output = []
|
||||||
for key, value in self.session._rates._asdict().items():
|
for key, value in self.session._rates._asdict().items():
|
||||||
|
@ -52,7 +52,7 @@ class Github:
|
||||||
async def start(self) -> None:
|
async def start(self) -> None:
|
||||||
"""Main entry point to the wrapper, this creates the ClientSession."""
|
"""Main entry point to the wrapper, this creates the ClientSession."""
|
||||||
if self.has_started:
|
if self.has_started:
|
||||||
raise AlreadyStarted
|
raise exceptions.AlreadyStarted
|
||||||
self.session = await http.make_session(headers=self._headers, authorization=self._auth)
|
self.session = await http.make_session(headers=self._headers, authorization=self._auth)
|
||||||
self.has_started = True
|
self.has_started = True
|
||||||
return self
|
return self
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue