diff options
author | John L. Villalovos <john@sodarock.com> | 2021-02-25 10:27:52 -0800 |
---|---|---|
committer | John L. Villalovos <john@sodarock.com> | 2021-02-25 10:39:31 -0800 |
commit | 213e5631b1efce11f8a1419cd77df5d9da7ec0ac (patch) | |
tree | 412318c738897c98bdaed1e2339f51afc3ce64aa /gitlab/config.py | |
parent | 0b67ca29d2cc6177e330b91519fdf54b05621769 (diff) | |
download | gitlab-213e5631b1efce11f8a1419cd77df5d9da7ec0ac.tar.gz |
chore: add type-hints to gitlab/config.py
Diffstat (limited to 'gitlab/config.py')
-rw-r--r-- | gitlab/config.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gitlab/config.py b/gitlab/config.py index 4647d61..710a354 100644 --- a/gitlab/config.py +++ b/gitlab/config.py @@ -17,17 +17,18 @@ import os import configparser +from typing import List, Optional, Union from gitlab.const import USER_AGENT -def _env_config(): +def _env_config() -> List[str]: if "PYTHON_GITLAB_CFG" in os.environ: return [os.environ["PYTHON_GITLAB_CFG"]] return [] -_DEFAULT_FILES = _env_config() + [ +_DEFAULT_FILES: List[str] = _env_config() + [ "/etc/python-gitlab.cfg", os.path.expanduser("~/.python-gitlab.cfg"), ] @@ -50,7 +51,9 @@ class GitlabConfigMissingError(ConfigError): class GitlabConfigParser(object): - def __init__(self, gitlab_id=None, config_files=None): + def __init__( + self, gitlab_id: Optional[str] = None, config_files: Optional[List[str]] = None + ) -> None: self.gitlab_id = gitlab_id _files = config_files or _DEFAULT_FILES file_exist = False @@ -85,7 +88,7 @@ class GitlabConfigParser(object): "configuration (%s)" % self.gitlab_id ) from e - self.ssl_verify = True + self.ssl_verify: Union[bool, str] = True try: self.ssl_verify = self._config.getboolean("global", "ssl_verify") except ValueError: |