kopia lustrzana https://github.com/Langenfeld/py-gitea
add proxy support
rodzic
33137fd185
commit
1be0b45f26
|
@ -28,6 +28,8 @@ class Gitea:
|
|||
auth=None,
|
||||
verify=True,
|
||||
log_level="INFO",
|
||||
# example: "socks5h://127.0.0.1:9050"
|
||||
proxy=None,
|
||||
):
|
||||
"""Initializing Gitea-instance
|
||||
|
||||
|
@ -48,6 +50,12 @@ class Gitea:
|
|||
self.url = gitea_url
|
||||
self.requests = requests.Session()
|
||||
|
||||
if proxy:
|
||||
self.requests.proxies = {
|
||||
"http": proxy,
|
||||
"https": proxy,
|
||||
}
|
||||
|
||||
# Manage authentification
|
||||
if not token_text and not auth:
|
||||
raise ValueError("Please provide auth or token_text, but not both")
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
requests
|
||||
requests[socks]
|
||||
pytest
|
||||
immutabledict
|
Ładowanie…
Reference in New Issue