kopia lustrzana https://github.com/Langenfeld/py-gitea
commit
ad08216ace
|
@ -21,7 +21,14 @@ class Gitea:
|
||||||
CREATE_TEAM = """/orgs/%s/teams""" # <orgname>
|
CREATE_TEAM = """/orgs/%s/teams""" # <orgname>
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self, gitea_url: str, token_text=None, auth=None, verify=True, log_level="INFO"
|
self,
|
||||||
|
gitea_url: str,
|
||||||
|
token_text=None,
|
||||||
|
auth=None,
|
||||||
|
verify=True,
|
||||||
|
log_level="INFO",
|
||||||
|
# example: "socks5h://127.0.0.1:9050"
|
||||||
|
proxy=None,
|
||||||
):
|
):
|
||||||
"""Initializing Gitea-instance
|
"""Initializing Gitea-instance
|
||||||
|
|
||||||
|
@ -42,6 +49,12 @@ class Gitea:
|
||||||
self.url = gitea_url
|
self.url = gitea_url
|
||||||
self.requests = requests.Session()
|
self.requests = requests.Session()
|
||||||
|
|
||||||
|
if proxy:
|
||||||
|
self.requests.proxies = {
|
||||||
|
"http": proxy,
|
||||||
|
"https": proxy,
|
||||||
|
}
|
||||||
|
|
||||||
# Manage authentification
|
# Manage authentification
|
||||||
if not token_text and not auth:
|
if not token_text and not auth:
|
||||||
raise ValueError("Please provide auth or token_text, but not both")
|
raise ValueError("Please provide auth or token_text, but not both")
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
requests
|
requests[socks]
|
||||||
pytest
|
pytest
|
||||||
immutabledict
|
immutabledict
|
Ładowanie…
Reference in New Issue