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

chore: add type-hints to gitlab/config.py#1331

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
max-wittig merged 1 commit intopython-gitlab:masterfromJohnVillalovos:jlvillal/mypy_config
Feb 25, 2021
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletionsgitlab/config.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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"),
]
Expand All@@ -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
Expand DownExpand Up@@ -85,7 +88,7 @@ def __init__(self, gitlab_id=None, config_files=None):
"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:
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp