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

Commitaf84700

Browse files
author
Gauvain Pocentek
committed
fix use of json() method from requests
1 parent7631e5e commitaf84700

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

‎gitlab.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ def credentials_auth(self):
8989
r=self.rawPost('/session',
9090
{'email':self.email,'password':self.password})
9191
ifr.status_code==201:
92-
self.user=CurrentUser(self,r.json)
92+
self.user=CurrentUser(self,r.json())
9393
else:
94-
raiseGitlabAuthenticationError(r.json['message'])
94+
raiseGitlabAuthenticationError(r.json()['message'])
9595

9696
self.private_token=self.user.private_token
9797

@@ -157,7 +157,7 @@ def list(self, obj_class, **kwargs):
157157
cls=obj_class
158158
ifobj_class._returnClass:
159159
cls=obj_class._returnClass
160-
l= [cls(self,item)foriteminr.json]
160+
l= [cls(self,item)foriteminr.json()]
161161
ifkwargs:
162162
fork,vinkwargs.items():
163163
ifkin ('page','per_page'):
@@ -166,7 +166,7 @@ def list(self, obj_class, **kwargs):
166166
obj.__dict__[k]=v
167167
returnl
168168
elifr.status_code==401:
169-
raiseGitlabAuthenticationError(r.json['message'])
169+
raiseGitlabAuthenticationError(r.json()['message'])
170170
else:
171171
raiseGitlabGetError('%d: %s'% (r.status_code,r.text))
172172

@@ -192,9 +192,9 @@ def get(self, obj_class, id=None, **kwargs):
192192
"Can't connect to GitLab server (%s)"%self._url)
193193

194194
ifr.status_code==200:
195-
returnr.json
195+
returnr.json()
196196
elifr.status_code==401:
197-
raiseGitlabAuthenticationError(r.json['message'])
197+
raiseGitlabAuthenticationError(r.json()['message'])
198198
else:
199199
raiseGitlabGetError('%d: %s'% (r.status_code,r.text))
200200

@@ -212,7 +212,7 @@ def delete(self, obj):
212212
ifr.status_code==200:
213213
returnTrue
214214
elifr.status_code==401:
215-
raiseGitlabAuthenticationError(r.json['message'])
215+
raiseGitlabAuthenticationError(r.json()['message'])
216216
returnFalse
217217

218218
defcreate(self,obj):
@@ -228,9 +228,9 @@ def create(self, obj):
228228
"Can't connect to GitLab server (%s)"%self._url)
229229

230230
ifr.status_code==201:
231-
returnr.json
231+
returnr.json()
232232
elifr.status_code==401:
233-
raiseGitlabAuthenticationError(r.json['message'])
233+
raiseGitlabAuthenticationError(r.json()['message'])
234234
else:
235235
raiseGitlabCreateError('%d: %s'% (r.status_code,r.text))
236236

@@ -252,9 +252,9 @@ def update(self, obj):
252252
"Can't connect to GitLab server (%s)"%self._url)
253253

254254
ifr.status_code==200:
255-
returnr.json
255+
returnr.json()
256256
elifr.status_code==401:
257-
raiseGitlabAuthenticationError(r.json['message'])
257+
raiseGitlabAuthenticationError(r.json()['message'])
258258
else:
259259
raiseGitlabUpdateError('%d: %s'% (r.status_code,r.text))
260260

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp