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

Commit5165354

Browse files
Testing...
1 parent3aef19c commit5165354

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

‎gitlab/client.py‎

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
importrequests.utils
2424

2525
importgitlab.config
26-
fromgitlab.constimport*# noqa
27-
fromgitlab.exceptionsimport*# noqa
28-
fromgitlabimportutils# noqa
26+
importgitlab.const
27+
importgitlab.exceptions
28+
fromgitlabimportutils
2929
fromrequests_toolbelt.multipart.encoderimportMultipartEncoder
3030

3131

@@ -70,7 +70,7 @@ def __init__(
7070
per_page=None,
7171
pagination=None,
7272
order_by=None,
73-
user_agent=USER_AGENT,
73+
user_agent=gitlab.const.USER_AGENT,
7474
):
7575

7676
self._api_version=str(api_version)
@@ -227,7 +227,7 @@ def version(self):
227227

228228
returnself._server_version,self._server_revision
229229

230-
@on_http_error(GitlabVerifyError)
230+
@gitlab.exceptions.on_http_error(gitlab.exceptions.GitlabVerifyError)
231231
deflint(self,content,**kwargs):
232232
"""Validate a gitlab CI configuration.
233233
@@ -247,7 +247,7 @@ def lint(self, content, **kwargs):
247247
data=self.http_post("/ci/lint",post_data=post_data,**kwargs)
248248
return (data["status"]=="valid",data["errors"])
249249

250-
@on_http_error(GitlabMarkdownError)
250+
@gitlab.exceptions.on_http_error(gitlab.exceptions.GitlabMarkdownError)
251251
defmarkdown(self,text,gfm=False,project=None,**kwargs):
252252
"""Render an arbitrary Markdown document.
253253
@@ -272,7 +272,7 @@ def markdown(self, text, gfm=False, project=None, **kwargs):
272272
data=self.http_post("/markdown",post_data=post_data,**kwargs)
273273
returndata["html"]
274274

275-
@on_http_error(GitlabLicenseError)
275+
@gitlab.exceptions.on_http_error(gitlab.exceptions.GitlabLicenseError)
276276
defget_license(self,**kwargs):
277277
"""Retrieve information about the current license.
278278
@@ -288,7 +288,7 @@ def get_license(self, **kwargs):
288288
"""
289289
returnself.http_get("/license",**kwargs)
290290

291-
@on_http_error(GitlabLicenseError)
291+
@gitlab.exceptions.on_http_error(gitlab.exceptions.GitlabLicenseError)
292292
defset_license(self,license,**kwargs):
293293
"""Add a new license.
294294
@@ -426,7 +426,7 @@ def _check_redirects(self, result):
426426
# Did we end-up with an https:// URL?
427427
location=item.headers.get("Location",None)
428428
iflocationandlocation.startswith("https://"):
429-
raiseRedirectError(REDIRECT_MSG)
429+
raisegitlab.exceptions.RedirectError(REDIRECT_MSG)
430430

431431
defhttp_request(
432432
self,
@@ -547,13 +547,13 @@ def http_request(
547547
pass
548548

549549
ifresult.status_code==401:
550-
raiseGitlabAuthenticationError(
550+
raisegitlab.exceptions.GitlabAuthenticationError(
551551
response_code=result.status_code,
552552
error_message=error_message,
553553
response_body=result.content,
554554
)
555555

556-
raiseGitlabHttpError(
556+
raisegitlab.exceptions.GitlabHttpError(
557557
response_code=result.status_code,
558558
error_message=error_message,
559559
response_body=result.content,
@@ -592,7 +592,7 @@ def http_get(self, path, query_data=None, streamed=False, raw=False, **kwargs):
592592
try:
593593
returnresult.json()
594594
exceptExceptionase:
595-
raiseGitlabParsingError(
595+
raisegitlab.exceptions.GitlabParsingError(
596596
error_message="Failed to parse the server message"
597597
)frome
598598
else:
@@ -674,7 +674,7 @@ def http_post(self, path, query_data=None, post_data=None, files=None, **kwargs)
674674
ifresult.headers.get("Content-Type",None)=="application/json":
675675
returnresult.json()
676676
exceptExceptionase:
677-
raiseGitlabParsingError(
677+
raisegitlab.exceptions.GitlabParsingError(
678678
error_message="Failed to parse the server message"
679679
)frome
680680
returnresult
@@ -712,7 +712,7 @@ def http_put(self, path, query_data=None, post_data=None, files=None, **kwargs):
712712
try:
713713
returnresult.json()
714714
exceptExceptionase:
715-
raiseGitlabParsingError(
715+
raisegitlab.exceptions.GitlabParsingError(
716716
error_message="Failed to parse the server message"
717717
)frome
718718

@@ -732,7 +732,7 @@ def http_delete(self, path, **kwargs):
732732
"""
733733
returnself.http_request("delete",path,**kwargs)
734734

735-
@on_http_error(GitlabSearchError)
735+
@gitlab.exceptions.on_http_error(gitlab.exceptions.GitlabSearchError)
736736
defsearch(self,scope,search,**kwargs):
737737
"""Search GitLab resources matching the provided string.'
738738
@@ -792,7 +792,7 @@ def _query(self, url, query_data=None, **kwargs):
792792
try:
793793
self._data=result.json()
794794
exceptExceptionase:
795-
raiseGitlabParsingError(
795+
raisegitlab.exceptions.GitlabParsingError(
796796
error_message="Failed to parse the server message"
797797
)frome
798798

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp