mirror of
https://github.com/RGBCube/GitHubWrapper
synced 2025-05-19 15:35:08 +00:00
Try 3.8 fixing?
This commit is contained in:
parent
a3aa1a51a8
commit
720b9f5e8d
3 changed files with 22 additions and 21 deletions
|
@ -7,6 +7,7 @@ __all__ = (
|
|||
|
||||
import asyncio
|
||||
import functools
|
||||
from typing import Union, List
|
||||
|
||||
import aiohttp
|
||||
|
||||
|
@ -23,11 +24,11 @@ class GHClient:
|
|||
def __init__(
|
||||
self,
|
||||
*,
|
||||
username: str | None = None,
|
||||
username: Union[str, None] = None,
|
||||
token: str | None = None,
|
||||
user_cache_size: int = 30,
|
||||
repo_cache_size: int = 15,
|
||||
custom_headers: dict[str, str | int] = {}
|
||||
custom_headers: dict[str, Union[str, int]] = {}
|
||||
):
|
||||
"""The main client, used to start most use-cases."""
|
||||
self._headers = custom_headers
|
||||
|
@ -138,7 +139,7 @@ class GHClient:
|
|||
"""Fetch a Github gist from it's id."""
|
||||
return Gist(await self.http.get_gist(gist), self.http.session)
|
||||
|
||||
async def create_gist(self, *, files: list[File], description: str, public: bool) -> Gist:
|
||||
async def create_gist(self, *, files: List[File], description: str, public: bool) -> Gist:
|
||||
"""Creates a Gist with the given files, requires authorisation."""
|
||||
return Gist(await self.http.create_gist(files=files, description=description, public=public), self.http.session)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue