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

Commitb815f3a

Browse files
author
Gauvain Pocentek
committed
'path' is an existing gitlab attr, don't use it
Use path_ instead of path as parameter name for methods using it.Otherwise it might conflict with GitlabObject attributes.
1 parentc08c913 commitb815f3a

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

‎gitlab/__init__.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -338,11 +338,11 @@ def enable_debug(self):
338338
requests_log.setLevel(logging.DEBUG)
339339
requests_log.propagate=True
340340

341-
def_raw_get(self,path,content_type=None,streamed=False,**kwargs):
342-
ifpath.startswith('http://')orpath.startswith('https://'):
343-
url=path
341+
def_raw_get(self,path_,content_type=None,streamed=False,**kwargs):
342+
ifpath_.startswith('http://')orpath_.startswith('https://'):
343+
url=path_
344344
else:
345-
url='%s%s'% (self._url,path)
345+
url='%s%s'% (self._url,path_)
346346

347347
headers=self._create_headers(content_type)
348348
try:
@@ -359,13 +359,13 @@ def _raw_get(self, path, content_type=None, streamed=False, **kwargs):
359359
raiseGitlabConnectionError(
360360
"Can't connect to GitLab server (%s)"%e)
361361

362-
def_raw_list(self,path,cls,extra_attrs={},**kwargs):
362+
def_raw_list(self,path_,cls,extra_attrs={},**kwargs):
363363
params=extra_attrs.copy()
364364
params.update(kwargs.copy())
365365

366366
get_all_results=kwargs.get('all',False)
367367

368-
r=self._raw_get(path,**params)
368+
r=self._raw_get(path_,**params)
369369
raise_error_from_response(r,GitlabListError)
370370

371371
# Remove parameters from kwargs before passing it to constructor
@@ -374,7 +374,7 @@ def _raw_list(self, path, cls, extra_attrs={}, **kwargs):
374374
delparams[key]
375375

376376
# Add _from_api manually, because we are not creating objects
377-
# through normalpath
377+
# through normalpath_
378378
params['_from_api']=True
379379

380380
results= [cls(self,item,**params)foriteminr.json()
@@ -386,8 +386,8 @@ def _raw_list(self, path, cls, extra_attrs={}, **kwargs):
386386
results.extend(self.list(cls,**args))
387387
returnresults
388388

389-
def_raw_post(self,path,data=None,content_type=None,**kwargs):
390-
url='%s%s'% (self._url,path)
389+
def_raw_post(self,path_,data=None,content_type=None,**kwargs):
390+
url='%s%s'% (self._url,path_)
391391
headers=self._create_headers(content_type)
392392
try:
393393
returnself.session.post(url,params=kwargs,data=data,
@@ -401,8 +401,8 @@ def _raw_post(self, path, data=None, content_type=None, **kwargs):
401401
raiseGitlabConnectionError(
402402
"Can't connect to GitLab server (%s)"%e)
403403

404-
def_raw_put(self,path,data=None,content_type=None,**kwargs):
405-
url='%s%s'% (self._url,path)
404+
def_raw_put(self,path_,data=None,content_type=None,**kwargs):
405+
url='%s%s'% (self._url,path_)
406406
headers=self._create_headers(content_type)
407407

408408
try:
@@ -417,8 +417,8 @@ def _raw_put(self, path, data=None, content_type=None, **kwargs):
417417
raiseGitlabConnectionError(
418418
"Can't connect to GitLab server (%s)"%e)
419419

420-
def_raw_delete(self,path,content_type=None,**kwargs):
421-
url='%s%s'% (self._url,path)
420+
def_raw_delete(self,path_,content_type=None,**kwargs):
421+
url='%s%s'% (self._url,path_)
422422
headers=self._create_headers(content_type)
423423

424424
try:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp