Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitab8105f

Browse files
committed
Build out more of our type-stubs
1 parentda2989c commitab8105f

File tree

3 files changed

+94
-1
lines changed

3 files changed

+94
-1
lines changed

‎github3/decorators.pyi‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
fromtypingimport (
2+
Any,
3+
)
4+
5+
importio
6+
7+
importrequests
8+
9+
10+
classRequestsStringIO(io.BytesIO):
11+
defread(self,n:int=-1,*args,**kwargs)->bytes:# type: ignore
12+
...
13+
14+
15+
# These decorators are broken until there's a solution to
16+
# https://github.com/python/typing/issues/193
17+
# https://github.com/python/mypy/issues/1317
18+
defrequires_auth(func:Any)->Any:
19+
...
20+
21+
22+
defrequires_basic_auth(func:Any)->Any:
23+
...
24+
25+
26+
defrequires_app_credentials(func:Any)->Any:
27+
...
28+
29+
30+
defgenerate_fake_error_message(
31+
msg:str,
32+
status_code:int=401,
33+
encoding:str='utf-8',
34+
)->requests.models.Response:
35+
...

‎github3/gists/gist.pyi‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
class_Gist:
1+
from ..importmodels
2+
3+
4+
class_Gist(models.GitHubCore):
25
...
36

47

‎github3/github.pyi‎

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ from typing import (
99
)
1010

1111
from .importauths
12+
from .importdecorators
1213
from .importevents
1314
from .importmodels
1415
from .importorgs
@@ -30,6 +31,7 @@ class GitHub(models.GitHubCore):
3031
)->None:
3132
...
3233

34+
@decorators.requires_auth
3335
defadd_email_addresses(
3436
self:T,
3537
addresses:List[str]=[],
@@ -70,6 +72,7 @@ class GitHub(models.GitHubCore):
7072
)->structs.GitHubIterator[users.ShortUser]:
7173
...
7274

75+
@decorators.requires_basic_auth
7376
defauthorization(
7477
self:T,
7578
id_num:Union[int,str],
@@ -109,6 +112,7 @@ class GitHub(models.GitHubCore):
109112
)->gist.Gist:
110113
...
111114

115+
@decorators.requires_auth
112116
defcreate_issue(
113117
self:T,
114118
owner:str,
@@ -122,6 +126,7 @@ class GitHub(models.GitHubCore):
122126
)->issue.ShortIssue:
123127
...
124128

129+
@decorators.requires_auth
125130
defcreate_key(
126131
self:T,
127132
title:str,
@@ -130,6 +135,7 @@ class GitHub(models.GitHubCore):
130135
)->users.Key:
131136
...
132137

138+
@decorators.requires_auth
133139
defcreate_repository(
134140
self:T,
135141
name:str,
@@ -143,12 +149,14 @@ class GitHub(models.GitHubCore):
143149
)->repo.Repository:
144150
...
145151

152+
@decorators.requires_auth
146153
defdelete_email_addresses(
147154
self:T,
148155
addresses:List[str],
149156
)->bool:
150157
...
151158

159+
@decorators.requires_auth
152160
defemails(
153161
self:T,
154162
number:int=-1,
@@ -162,6 +170,7 @@ class GitHub(models.GitHubCore):
162170
deffeeds(self:T)->Dict[str,Any]:
163171
...
164172

173+
@decorators.requires_auth
165174
deffollow(
166175
self:T,
167176
username:str
@@ -175,3 +184,49 @@ class GitHub(models.GitHubCore):
175184
etag:Optional[str]=None,
176185
)->structs.GitHubIterator[users.ShortUser]:
177186
...
187+
188+
@decorators.requires_auth
189+
deffollowers(
190+
self:T,
191+
number:int=-1,
192+
etag:Optional[str]=None,
193+
)->structs.GitHubIterator[users.ShortUser]:
194+
...
195+
196+
deffollowers_of(
197+
self:T,
198+
username:str,
199+
number:int=-1,
200+
etag:Optional[str]=None,
201+
)->structs.GitHubIterator[users.ShortUser]:
202+
...
203+
204+
@decorators.requires_auth
205+
deffollowing(
206+
self:T,
207+
number:int=-1,
208+
etag:Optional[str]=None,
209+
)->structs.GitHubIterator[users.ShortUser]:
210+
...
211+
212+
defgist(
213+
self:T,
214+
id_num:int,
215+
)->gist.Gist:
216+
...
217+
218+
@decorators.requires_auth
219+
defgists(
220+
self:T,
221+
number:int=-1,
222+
etag:Optional[str]=None,
223+
)->structs.GitHubIterator[gist.ShortGist]:
224+
...
225+
226+
defgists_by(
227+
self:T,
228+
username:str,
229+
number:int=-1,
230+
etag:Optional[str]=None,
231+
)->structs.GitHubIterator[gist.ShortGist]:
232+
...

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp