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

Commitc6de035

Browse files
committed
PEP8 changes.
1 parent9a1905f commitc6de035

File tree

11 files changed

+150
-148
lines changed

11 files changed

+150
-148
lines changed

‎github3/auths.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def delete(self):
5252

5353
@requires_basic_auth
5454
defupdate(self,scopes=[],add_scopes=[],rm_scopes=[],note='',
55-
note_url=''):
55+
note_url=''):
5656
"""Update this authorization.
5757
5858
:param scopes: (optional), replaces the authorization scopes with these

‎github3/decorators.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def auth_wrapper(self, *args, **kwargs):
2525
auth=False
2626
ifhasattr(self,'_session'):
2727
auth= (self._session.author
28-
self._session.headers.get('Authorization'))
28+
self._session.headers.get('Authorization'))
2929

3030
ifauth:
3131
returnfunc(self,*args,**kwargs)
@@ -54,7 +54,7 @@ def auth_wrapper(self, *args, **kwargs):
5454
r.status_code=401
5555
r.encoding='utf-8'
5656
msg= ('{"message": "Requires username/password '
57-
'authentication"}').encode()
57+
'authentication"}').encode()
5858
r.raw=StringIO(msg)
5959
raiseGitHubError(r)
6060
returnauth_wrapper

‎github3/events.py‎

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -142,22 +142,22 @@ def _team(payload):
142142

143143

144144
_payload_handlers= {
145-
'CommitCommentEvent':_commitcomment,
146-
'CreateEvent':lambdax:x,
147-
'DeleteEvent':lambdax:x,
148-
'DownloadEvent':_download,
149-
'FollowEvent':_follow,
150-
'ForkEvent':_forkev,
151-
'ForkApplyEvent':lambdax:x,
152-
'GistEvent':_gist,
153-
'GollumEvent':lambdax:x,
154-
'IssueCommentEvent':_issuecomm,
155-
'IssuesEvent':_issueevent,
156-
'MemberEvent':_member,
157-
'PublicEvent':lambdax:'',
158-
'PullRequestEvent':_pullreqev,
159-
'PullRequestReviewCommentEvent':_pullreqcomm,
160-
'PushEvent':lambdax:x,
161-
'TeamAddEvent':_team,
162-
'WatchEvent':lambdax:x,
163-
}
145+
'CommitCommentEvent':_commitcomment,
146+
'CreateEvent':lambdax:x,
147+
'DeleteEvent':lambdax:x,
148+
'DownloadEvent':_download,
149+
'FollowEvent':_follow,
150+
'ForkEvent':_forkev,
151+
'ForkApplyEvent':lambdax:x,
152+
'GistEvent':_gist,
153+
'GollumEvent':lambdax:x,
154+
'IssueCommentEvent':_issuecomm,
155+
'IssuesEvent':_issueevent,
156+
'MemberEvent':_member,
157+
'PublicEvent':lambdax:'',
158+
'PullRequestEvent':_pullreqev,
159+
'PullRequestReviewCommentEvent':_pullreqcomm,
160+
'PushEvent':lambdax:x,
161+
'TeamAddEvent':_team,
162+
'WatchEvent':lambdax:x,
163+
}

‎github3/git.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def recurse(self):
180180
:returns: :class:`Tree <Tree>`
181181
"""
182182
json=self._json(self._get(self._api,params={'recursive':'1'}),
183-
200)
183+
200)
184184
returnTree(json,self._session)ifjsonelseNone
185185

186186

‎github3/issues.py‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def update(self, name, color):
5252
ifcolor[0]=='#':
5353
color=color[1:]
5454
json=self._json(self._patch(self._api,data=dumps({'name':name,
55-
'color':color})),200)
55+
'color':color})),200)
5656

5757
ifjson:
5858
self._update_(json)
@@ -140,7 +140,7 @@ def update(self, title, state='', description='', due_on=''):
140140
:returns: bool
141141
"""
142142
data=dumps({'title':title,'state':state,
143-
'description':description,'due_on':due_on})
143+
'description':description,'due_on':due_on})
144144
json=None
145145

146146
iftitle:
@@ -210,7 +210,7 @@ def __init__(self, issue, session=None):
210210

211211
def__repr__(self):
212212
return'<Issue [{r[0]}/{r[1]} #{n}]>'.format(r=self.repository,
213-
n=self.number)
213+
n=self.number)# nopep8
214214

215215
def_update_(self,issue):
216216
self.__init__(issue,self._session)
@@ -224,7 +224,7 @@ def add_labels(self, *args):
224224
"""
225225
url=self._build_url('labels',base_url=self._api)
226226
json=self._json(self._post(url,data=dumps(list(args))),
227-
status_code=200)
227+
status_code=200)
228228
returnTrueifjsonelseFalse
229229

230230
@requires_auth
@@ -239,7 +239,7 @@ def assign(self, login):
239239
returnFalse
240240
number=self.milestone.numberifself.milestoneelseNone
241241
returnself.edit(self.title,self.body,login,self.state,number,
242-
self.labels)
242+
self.labels)
243243

244244
@requires_auth
245245
defclose(self):
@@ -250,7 +250,7 @@ def close(self):
250250
assignee=self.assignee.loginifself.assigneeelse''
251251
number=self.milestone.numberifself.milestoneelseNone
252252
returnself.edit(self.title,self.body,assignee,'closed',
253-
number,self.labels)
253+
number,self.labels)
254254

255255
defcomment(self,id_num):
256256
"""Get a single comment by its id.
@@ -266,7 +266,7 @@ def comment(self, id_num):
266266
ifint(id_num)>0:# Might as well check that it's positive
267267
owner,repo=self.repository
268268
url=self._build_url('repos',owner,repo,'issues','comments',
269-
str(id_num))
269+
str(id_num))
270270
json=self._json(self._get(url),200)
271271
returnIssueComment(json)ifjsonelseNone
272272

@@ -285,7 +285,7 @@ def create_comment(self, body):
285285

286286
@requires_auth
287287
defedit(self,title=None,body=None,assignee=None,state=None,
288-
milestone=None,labels=None):
288+
milestone=None,labels=None):
289289
"""Edit this issue.
290290
291291
:param title: Title of the issue
@@ -404,7 +404,7 @@ def reopen(self):
404404
assignee=self.assignee.loginifself.assigneeelse''
405405
number=self.milestone.numberifself.milestoneelseNone
406406
returnself.edit(self.title,self.body,assignee,'open',
407-
number,self.labels)
407+
number,self.labels)
408408

409409

410410
classIssueComment(BaseComment):
@@ -456,7 +456,7 @@ def __init__(self, event, issue=None):
456456

457457
def__repr__(self):
458458
return'<Issue Event [#{0} - {1}]>'.format(self.issue.number,
459-
self.event)
459+
self.event)# nopep8
460460

461461

462462
defissue_params(filter,state,labels,sort,direction,since):

‎github3/models.py‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@ def __init__(self, json, ses=None):
5757
ses=session()
5858
self._session=ses
5959
headers= {
60-
# Only accept JSON responses
61-
'Accept':'application/vnd.github.v3.full+json',
62-
# Only accept UTF-8 encoded data
63-
'Accept-Charset':'utf-8',
64-
# Always sending JSON
65-
'Content-Type':"application/json",
66-
# Set our own custom User-Agent string
67-
'User-Agent':'github3.py/0.1b0',
68-
}
60+
# Only accept JSON responses
61+
'Accept':'application/vnd.github.v3.full+json',
62+
# Only accept UTF-8 encoded data
63+
'Accept-Charset':'utf-8',
64+
# Always sending JSON
65+
'Content-Type':"application/json",
66+
# Set our own custom User-Agent string
67+
'User-Agent':'github3.py/0.1b0',
68+
}
6969

7070
self._session.headers.update(headers)
7171
self._session.config['base_headers'].update(headers)

‎github3/notifications.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def mark(self):
6161
"""
6262
mark= {'read':True}
6363
returnself._boolean(self._patch(self._api,data=dumps(mark)),205,
64-
404)
64+
404)
6565

6666
defset_subscription(self,subscribed,ignored):
6767
"""Set the user's subscription for this thread

‎github3/orgs.py‎

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -217,16 +217,16 @@ def add_repo(self, repo, team):
217217

218218
@requires_auth
219219
defcreate_repo(self,
220-
name,
221-
description='',
222-
homepage='',
223-
private=False,
224-
has_issues=True,
225-
has_wiki=True,
226-
has_downloads=True,
227-
team_id=0,
228-
auto_init=False,
229-
gitignore_template=''):
220+
name,
221+
description='',
222+
homepage='',
223+
private=False,
224+
has_issues=True,
225+
has_wiki=True,
226+
has_downloads=True,
227+
team_id=0,
228+
auto_init=False,
229+
gitignore_template=''):
230230
"""Create a repository for this organization if the authenticated user
231231
is a member.
232232
@@ -252,10 +252,10 @@ def create_repo(self,
252252
"""
253253
url=self._build_url('repos',base_url=self._api)
254254
data= {'name':name,'description':description,
255-
'homepage':homepage,'private':private,
256-
'has_issues':has_issues,'has_wiki':has_wiki,
257-
'has_downloads':has_downloads,'auto_init':auto_init,
258-
'gitignore_template':gitignore_template}
255+
'homepage':homepage,'private':private,
256+
'has_issues':has_issues,'has_wiki':has_wiki,
257+
'has_downloads':has_downloads,'auto_init':auto_init,
258+
'gitignore_template':gitignore_template}
259259
ifteam_id>0:
260260
data.update({'team_id':team_id})
261261
json=self._json(self._post(url,dumps(data)),201)
@@ -293,18 +293,18 @@ def create_team(self, name, repo_names=[], permissions=''):
293293
:returns: :class:`Team <Team>`
294294
"""
295295
data=dumps({'name':name,'repo_names':repo_names,
296-
'permissions':permissions})
296+
'permissions':permissions})
297297
url=self._build_url('teams',base_url=self._api)
298298
json=self._json(self._post(url,data),201)
299299
returnTeam(json,self._session)ifjsonelseNone
300300

301301
@requires_auth
302302
defedit(self,
303-
billing_email=None,
304-
company=None,
305-
email=None,
306-
location=None,
307-
name=None):
303+
billing_email=None,
304+
company=None,
305+
email=None,
306+
location=None,
307+
name=None):
308308
"""Edit this organization.
309309
310310
:param billing_email: (optional) Billing email address (private)
@@ -321,7 +321,7 @@ def edit(self,
321321
"""
322322
json=None
323323
data= {'billing_email':billing_email,'company':company,
324-
'email':email,'location':location,'name':name}
324+
'email':email,'location':location,'name':name}
325325
for (k,v)indata.items():
326326
ifvisNone:
327327
deldata[k]

‎github3/pulls.py‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,13 @@ def __init__(self, pull, session=None):
114114
# https://api.github.com/repos/:user/:repo/pulls/:number/comments
115115
#: Dictionary of _links
116116
self.links= {
117-
'self':self._api,
118-
'comments':'/'.join([self._api.replace('pulls','issues'),
119-
'comments']),
120-
'issue':self._api.replace('pulls','issues'),
121-
'html':self.html_url,
122-
'review_comments':self._api+'/comments'
123-
}
117+
'self':self._api,
118+
'comments':'/'.join([self._api.replace('pulls','issues'),
119+
'comments']),
120+
'issue':self._api.replace('pulls','issues'),
121+
'html':self.html_url,
122+
'review_comments':self._api+'/comments'
123+
}
124124

125125
#: SHA of the merge commit
126126
self.merge_commit_sha=pull.get('merge_commit_sha','')

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp