From dedaf4e59b8fd61d9cafdf0cdfb6d5c51efda7f3 Mon Sep 17 00:00:00 2001 From: VarMonke Date: Wed, 13 Apr 2022 23:14:06 +0530 Subject: [PATCH] remove duplicate url and return delete_gist --- Github/main.py | 9 +++++---- Github/urls.py | 3 +-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Github/main.py b/Github/main.py index b77b938..493d936 100644 --- a/Github/main.py +++ b/Github/main.py @@ -133,15 +133,16 @@ class GHClient: return Repository(await self.http.get_repo(owner, repo), self.http.session) async def get_issue(self, *, owner: str, repo: str, issue: int) -> Issue: - """Fetch a Github repository from it's name.""" + """Fetch a Github Issue from it's name.""" return Issue(await self.http.get_repo_issue(owner, repo, issue), self.http.session) async def create_repo(self, name: str, description: str = 'Repository created using Github-Api-Wrapper.', public: bool = False,gitignore: str = None, license: str = None) -> Repository: return Repository(await self.http.create_repo(name,description,public,gitignore,license), self.http.session) - async def delete_repo(self, owner: str , repo: str) -> None: + async def delete_repo(self, owner: str = None, repo: str= None) -> None: """Delete a Github repository, requires authorisation.""" - await self.http.delete_repo(owner, repo) + owner = owner or self.username + return await self.http.delete_repo(owner, repo) async def get_gist(self, gist: int) -> Gist: """Fetch a Github gist from it's id.""" @@ -153,7 +154,7 @@ class GHClient: async def delete_gist(self, gist: int) -> None: """Delete a Github gist, requires authorisation.""" - await self.http.delete_gist(gist) + return await self.http.delete_gist(gist) async def get_org(self, org: str) -> Organization: """Fetch a Github organization from it's name.""" diff --git a/Github/urls.py b/Github/urls.py index be0e1d8..ae6c4b4 100644 --- a/Github/urls.py +++ b/Github/urls.py @@ -32,9 +32,8 @@ REPO_ISSUE_URL = REPO_URL + '/issues/{2}' # a specific issue #== gist urls ==# GIST_URL = BASE_URL + '/gists/{0}' # specific gist -CREATE_GIST_URL = BASE_URL + '/gists' # create a gist -CREATE_GIST_URL = BASE_URL + '/gists' +CREATE_GIST_URL = BASE_URL + '/gists' # create a gist #== org urls ==# ORG_URL = BASE_URL + '/orgs/{0}' \ No newline at end of file