diff options
| author | Nejc Habjan <nejc.habjan@siemens.com> | 2023-01-30 20:57:54 +0100 |
|---|---|---|
| committer | John Villalovos <john@sodarock.com> | 2023-01-30 13:43:41 -0800 |
| commit | 1e629af73e312fea39522334869c3a9b7e6085b9 (patch) | |
| tree | 017a49009bf235ab210ef503b546dfefa839d6ed /gitlab | |
| parent | ea7010b17cc2c29c2a5adeaf81f2d0064523aa39 (diff) | |
| download | gitlab-1e629af73e312fea39522334869c3a9b7e6085b9.tar.gz | |
chore: make backends private
Diffstat (limited to 'gitlab')
| -rw-r--r-- | gitlab/_backends/__init__.py (renamed from gitlab/http_backends/__init__.py) | 0 | ||||
| -rw-r--r-- | gitlab/_backends/requests_backend.py (renamed from gitlab/http_backends/requests_backend.py) | 0 | ||||
| -rw-r--r-- | gitlab/client.py | 20 |
3 files changed, 10 insertions, 10 deletions
diff --git a/gitlab/http_backends/__init__.py b/gitlab/_backends/__init__.py index aa53d0a..aa53d0a 100644 --- a/gitlab/http_backends/__init__.py +++ b/gitlab/_backends/__init__.py diff --git a/gitlab/http_backends/requests_backend.py b/gitlab/_backends/requests_backend.py index 4ea23a7..4ea23a7 100644 --- a/gitlab/http_backends/requests_backend.py +++ b/gitlab/_backends/requests_backend.py diff --git a/gitlab/client.py b/gitlab/client.py index e5daf18..5e6c71a 100644 --- a/gitlab/client.py +++ b/gitlab/client.py @@ -12,7 +12,7 @@ import gitlab import gitlab.config import gitlab.const import gitlab.exceptions -from gitlab import http_backends, utils +from gitlab import _backends, utils REDIRECT_MSG = ( "python-gitlab detected a {status_code} ({reason!r}) redirection. You must update " @@ -52,9 +52,9 @@ class Gitlab: keep_base_url: keep user-provided base URL for pagination if it differs from response headers - Keyward Args: - requests.Session session: Http Requests Session - RequestsBackend http_backend: Backend that will be used to make http requests + Keyword Args: + requests.Session session: HTTP Requests Session + RequestsBackend backend: Backend that will be used to make http requests """ def __init__( @@ -99,11 +99,11 @@ class Gitlab: self._set_auth_info() #: Create a session object for requests - http_backend: Type[http_backends.DefaultBackend] = kwargs.pop( - "http_backend", http_backends.DefaultBackend + _backend: Type[_backends.DefaultBackend] = kwargs.pop( + "backend", _backends.DefaultBackend ) - self.http_backend = http_backend(**kwargs) - self.session = self.http_backend.client + self._backend = _backend(**kwargs) + self.session = self._backend.client self.per_page = per_page self.pagination = pagination @@ -716,7 +716,7 @@ class Gitlab: retry_transient_errors = self.retry_transient_errors # We need to deal with json vs. data when uploading files - json, data, content_type = self.http_backend.prepare_send_data( + json, data, content_type = self._backend.prepare_send_data( files, post_data, raw ) opts["headers"]["Content-type"] = content_type @@ -724,7 +724,7 @@ class Gitlab: cur_retries = 0 while True: try: - result = self.http_backend.http_request( + result = self._backend.http_request( method=verb, url=url, json=json, |
