mirror of
https://github.com/RGBCube/GitHubWrapper
synced 2025-05-31 13:08:12 +00:00
Merge branch 'main' of https://github.com/VarMonke/Github-Api-Wrapper
This commit is contained in:
commit
359c483c66
3 changed files with 10 additions and 3 deletions
|
@ -4,3 +4,6 @@ sphinx:
|
|||
configuration: docs/conf.py
|
||||
fail_on_warning: false
|
||||
builder: html
|
||||
|
||||
python:
|
||||
version: 3.8
|
|
@ -59,4 +59,6 @@ html_favicon = './assets/Github-Python.png'
|
|||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
html_static_path = ['_static']
|
||||
html_static_path = ['_static']
|
||||
|
||||
autodoc_mock_imports = ["typing_extensions"]
|
|
@ -190,14 +190,16 @@ class GHClient:
|
|||
@functools.wraps(func)
|
||||
async def wrapped(self: Self, *args: P.args, **kwargs: P.kwargs) -> Optional[Union[T, User, Repository]]:
|
||||
if type == 'user':
|
||||
if obj := self._user_cache.get(kwargs.get('user')):
|
||||
obj = self._user_cache.get(kwargs.get('user'))
|
||||
if obj:
|
||||
return obj
|
||||
|
||||
user: User = await func(self, *args, **kwargs) # type: ignore
|
||||
self._user_cache[kwargs.get("user")] = user
|
||||
return user
|
||||
if type == 'repo':
|
||||
if obj := self._repo_cache.get(kwargs.get('repo')):
|
||||
obj = self._repo_cache.get(kwargs.get('repo'))
|
||||
if obj:
|
||||
return obj
|
||||
|
||||
repo: Repository = await func(self, *args, **kwargs) # type: ignore
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue