diff options
author | Nejc Habjan <hab.nejc@gmail.com> | 2021-01-31 11:10:41 +0100 |
---|---|---|
committer | Nejc Habjan <hab.nejc@gmail.com> | 2021-01-31 17:56:53 +0100 |
commit | 4bb201b92ef0dcc14a7a9c83e5600ba5b118fc33 (patch) | |
tree | bb6a33482b65595d372f6508974bdee7f45da935 /gitlab/config.py | |
parent | 48cb89bad043f7e406e2358a20512653fc40556d (diff) | |
download | gitlab-4bb201b92ef0dcc14a7a9c83e5600ba5b118fc33.tar.gz |
feat(api,cli): make user agent configurable
Diffstat (limited to 'gitlab/config.py')
-rw-r--r-- | gitlab/config.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gitlab/config.py b/gitlab/config.py index c8ba896..4647d61 100644 --- a/gitlab/config.py +++ b/gitlab/config.py @@ -18,6 +18,8 @@ import os import configparser +from gitlab.const import USER_AGENT + def _env_config(): if "PYTHON_GITLAB_CFG" in os.environ: @@ -177,3 +179,13 @@ class GitlabConfigParser(object): self.order_by = self._config.get(self.gitlab_id, "order_by") except Exception: pass + + self.user_agent = USER_AGENT + try: + self.user_agent = self._config.get("global", "user_agent") + except Exception: + pass + try: + self.user_agent = self._config.get(self.gitlab_id, "user_agent") + except Exception: + pass |