Skip to content

Commit 213e563

Browse files
chore: add type-hints to gitlab/config.py
1 parent 0b67ca2 commit 213e563

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

gitlab/config.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,18 @@
1717

1818
import os
1919
import configparser
20+
from typing import List, Optional, Union
2021

2122
from gitlab.const import USER_AGENT
2223

2324

24-
def _env_config():
25+
def _env_config() -> List[str]:
2526
if "PYTHON_GITLAB_CFG" in os.environ:
2627
return [os.environ["PYTHON_GITLAB_CFG"]]
2728
return []
2829

2930

30-
_DEFAULT_FILES = _env_config() + [
31+
_DEFAULT_FILES: List[str] = _env_config() + [
3132
"/etc/python-gitlab.cfg",
3233
os.path.expanduser("~/.python-gitlab.cfg"),
3334
]
@@ -50,7 +51,9 @@ class GitlabConfigMissingError(ConfigError):
5051

5152

5253
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:
5457
self.gitlab_id = gitlab_id
5558
_files = config_files or _DEFAULT_FILES
5659
file_exist = False
@@ -85,7 +88,7 @@ def __init__(self, gitlab_id=None, config_files=None):
8588
"configuration (%s)" % self.gitlab_id
8689
) from e
8790

88-
self.ssl_verify = True
91+
self.ssl_verify: Union[bool, str] = True
8992
try:
9093
self.ssl_verify = self._config.getboolean("global", "ssl_verify")
9194
except ValueError:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy