|
12 | 12 | importgitlab.config |
13 | 13 | importgitlab.const |
14 | 14 | importgitlab.exceptions |
15 | | -fromgitlabimporthttp_backends,utils |
| 15 | +fromgitlabimport_backends,utils |
16 | 16 |
|
17 | 17 | REDIRECT_MSG= ( |
18 | 18 | "python-gitlab detected a {status_code} ({reason!r}) redirection. You must update " |
@@ -52,9 +52,9 @@ class Gitlab: |
52 | 52 | keep_base_url: keep user-provided base URL for pagination if it |
53 | 53 | differs from response headers |
54 | 54 |
|
55 | | -Keyward Args: |
56 | | - requests.Session session:Http Requests Session |
57 | | - RequestsBackendhttp_backend: Backend that will be used to make http requests |
| 55 | +Keyword Args: |
| 56 | + requests.Session session:HTTP Requests Session |
| 57 | + RequestsBackendbackend: Backend that will be used to make http requests |
58 | 58 | """ |
59 | 59 |
|
60 | 60 | def__init__( |
@@ -99,11 +99,11 @@ def __init__( |
99 | 99 | self._set_auth_info() |
100 | 100 |
|
101 | 101 | #: Create a session object for requests |
102 | | -http_backend:Type[http_backends.DefaultBackend]=kwargs.pop( |
103 | | -"http_backend",http_backends.DefaultBackend |
| 102 | +_backend:Type[_backends.DefaultBackend]=kwargs.pop( |
| 103 | +"backend",_backends.DefaultBackend |
104 | 104 | ) |
105 | | -self.http_backend=http_backend(**kwargs) |
106 | | -self.session=self.http_backend.client |
| 105 | +self._backend=_backend(**kwargs) |
| 106 | +self.session=self._backend.client |
107 | 107 |
|
108 | 108 | self.per_page=per_page |
109 | 109 | self.pagination=pagination |
@@ -716,15 +716,15 @@ def http_request( |
716 | 716 | retry_transient_errors=self.retry_transient_errors |
717 | 717 |
|
718 | 718 | # We need to deal with json vs. data when uploading files |
719 | | -json,data,content_type=self.http_backend.prepare_send_data( |
| 719 | +json,data,content_type=self._backend.prepare_send_data( |
720 | 720 | files,post_data,raw |
721 | 721 | ) |
722 | 722 | opts["headers"]["Content-type"]=content_type |
723 | 723 |
|
724 | 724 | cur_retries=0 |
725 | 725 | whileTrue: |
726 | 726 | try: |
727 | | -result=self.http_backend.http_request( |
| 727 | +result=self._backend.http_request( |
728 | 728 | method=verb, |
729 | 729 | url=url, |
730 | 730 | json=json, |
|