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

Commitf09089b

Browse files
author
Gauvain Pocentek
committed
Expose additional properties for Gitlab objects
* url: the URL provided by the user (from config or constructor)* api_url: the computed base endpoint (URL/api/v?)Fixes#474
1 parent32b399a commitf09089b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

‎gitlab/__init__.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ def __init__(self, url, private_token=None, oauth_token=None, email=None,
7878

7979
self._api_version=str(api_version)
8080
self._server_version=self._server_revision=None
81+
self._base_url=url
8182
self._url='%s/api/v%s'% (url,api_version)
8283
#: Timeout to use for requests to gitlab server
8384
self.timeout=timeout
@@ -164,8 +165,19 @@ def __setstate__(self, state):
164165
self._api_version)
165166
self._objects=objects
166167

168+
@property
169+
defurl(self):
170+
"""The user-provided server URL."""
171+
returnself._base_url
172+
173+
@property
174+
defapi_url(self):
175+
"""The computed API base URL."""
176+
returnself._url
177+
167178
@property
168179
defapi_version(self):
180+
"""The API version used (3 or 4)."""
169181
returnself._api_version
170182

171183
def_cls_to_manager_prefix(self,cls):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp