1
Fork 0
mirror of https://github.com/RGBCube/GitHubWrapper synced 2025-05-18 15:05:08 +00:00

Getting issues added

This commit is contained in:
VarMonke 2022-03-30 20:46:18 +05:30
parent 6ed2deb92d
commit 5e44401601
5 changed files with 55 additions and 1 deletions

View file

@ -8,6 +8,7 @@ from types import SimpleNamespace
import re
from .exceptions import *
from .exceptions import IssueNotFound
from .objects import *
from .urls import *
@ -130,6 +131,13 @@ async def get_repo_from_name(session: aiohttp.ClientSession, owner: str, repo_na
return await result.json()
raise RepositoryNotFound
async def get_repo_issue(session: aiohttp.ClientSession, owner: str, repo_name: str, issue_number: int) -> dict[str, str]:
"""Returns a single issue from the given owner and repo name."""
result = await session.get(REPO_ISSUE_URL.format(owner, repo_name, issue_number))
if result.status == 200:
return await result.json()
raise IssueNotFound
# org-related functions / utils
async def get_org(session: aiohttp.ClientSession, org_name: str):