| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 0b67ca2 commit 213e563
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -17,17 +17,18 @@ | |||
| 17 | 17 | ||
| 18 | 18 | import os | |
| 19 | 19 | import configparser | |
| 20 | + from typing import List, Optional, Union | ||
| 20 | 21 | ||
| 21 | 22 | from gitlab.const import USER_AGENT | |
| 22 | 23 | ||
| 23 | 24 | ||
| 24 | - def _env_config(): | ||
| 25 | + def _env_config() -> List[str]: | ||
| 25 | 26 | if "PYTHON_GITLAB_CFG" in os.environ: | |
| 26 | 27 | return [os.environ["PYTHON_GITLAB_CFG"]] | |
| 27 | 28 | return [] | |
| 28 | 29 | ||
| 29 | 30 | ||
| 30 | - _DEFAULT_FILES = _env_config() + [ | ||
| 31 | + _DEFAULT_FILES: List[str] = _env_config() + [ | ||
| 31 | 32 | "/etc/python-gitlab.cfg", | |
| 32 | 33 | os.path.expanduser("~/.python-gitlab.cfg"), | |
| 33 | 34 | ] | |
@@ -50,7 +51,9 @@ class GitlabConfigMissingError(ConfigError): | |||
| 50 | 51 | ||
| 51 | 52 | ||
| 52 | 53 | class GitlabConfigParser(object): | |
| 53 | - def __init__(self, gitlab_id=None, config_files=None): | ||
| 54 | + def __init__( | ||
| 55 | + self, gitlab_id: Optional[str] = None, config_files: Optional[List[str]] = None | ||
| 56 | + ) -> None: | ||
| 54 | 57 | self.gitlab_id = gitlab_id | |
| 55 | 58 | _files = config_files or _DEFAULT_FILES | |
| 56 | 59 | file_exist = False | |
@@ -85,7 +88,7 @@ def __init__(self, gitlab_id=None, config_files=None): | |||
| 85 | 88 | "configuration (%s)" % self.gitlab_id | |
| 86 | 89 | ) from e | |
| 87 | 90 | ||
| 88 | - self.ssl_verify = True | ||
| 91 | + self.ssl_verify: Union[bool, str] = True | ||
| 89 | 92 | try: | |
| 90 | 93 | self.ssl_verify = self._config.getboolean("global", "ssl_verify") | |
| 91 | 94 | except ValueError: | |
| Back | FazBrowse Home | New Git URL |
0 commit comments