|
1 | 1 | import pyhttpx
|
2 | 2 |
|
3 |
| -from . import Exceptions |
| 3 | +from extendingPython.GiteeAPI import GiteeAPIExceptions |
4 | 4 |
|
5 | 5 |
|
6 | 6 | def getTheUserWhoStarTheRepo(owner: str, repo: str, page: int = -1, access_token: str = '', per_page: int = 100):
|
@@ -47,9 +47,9 @@ def getTheUserWhoStarTheRepo(owner: str, repo: str, page: int = -1, access_token
|
47 | 47 | res = session.get(url, params=params)
|
48 | 48 | res = res.json()
|
49 | 49 | if len(res) != 0 and res.get("message") == "Not Found Project":
|
50 |
| - raise Exceptions.NotFoundProject("The project is not found or your project is private") |
| 50 | + raise GiteeAPIExceptions.NotFoundProject("The project is not found or your project is private") |
51 | 51 | elif len(res) != 0 and res.get("message") == "401 Unauthorized: Access token does not exist":
|
52 |
| - raise Exceptions.AccessTokenNotExist("Access token does not exist") |
| 52 | + raise GiteeAPIExceptions.AccessTokenNotExist("Access token does not exist") |
53 | 53 | return res
|
54 | 54 |
|
55 | 55 |
|
@@ -98,9 +98,9 @@ def getTheUserWhoWatchTheRepo(owner: str, repo: str, page: int = -1, access_toke
|
98 | 98 | res = res.json()
|
99 | 99 | try:
|
100 | 100 | if res.get("message") == "Not Found Project":
|
101 |
| - raise Exceptions.NotFoundProject("The project is not found or your project is private") |
| 101 | + raise GiteeAPIExceptions.NotFoundProject("The project is not found or your project is private") |
102 | 102 | elif res.get("message") == "401 Unauthorized: Access token does not exist":
|
103 |
| - raise Exceptions.AccessTokenNotExist("Access token does not exist") |
| 103 | + raise GiteeAPIExceptions.AccessTokenNotExist("Access token does not exist") |
104 | 104 | except AttributeError:
|
105 | 105 | pass
|
106 | 106 | return res
|
@@ -151,9 +151,9 @@ def getTheMassageFromTheRepo(owner: str, repo: str, access_token: str = '', limi
|
151 | 151 | res = res.json()
|
152 | 152 | try:
|
153 | 153 | if res.get("message") == "Not Found Project":
|
154 |
| - raise Exceptions.NotFoundProject("The project is not found or your project is private") |
| 154 | + raise GiteeAPIExceptions.NotFoundProject("The project is not found or your project is private") |
155 | 155 | elif res.get("message") == "401 Unauthorized: Access token does not exist":
|
156 |
| - raise Exceptions.AccessTokenNotExist("Access token does not exist") |
| 156 | + raise GiteeAPIExceptions.AccessTokenNotExist("Access token does not exist") |
157 | 157 | except AttributeError:
|
158 | 158 | pass
|
159 | 159 | return res
|
0 commit comments