Skip to content
Snippets Groups Projects
Commit eb7bdf71 authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

requests → httpx

parent b70d8e2a
No related branches found
No related tags found
No related merge requests found
...@@ -4,7 +4,7 @@ from io import BytesIO ...@@ -4,7 +4,7 @@ from io import BytesIO
from pathlib import Path from pathlib import Path
from zipfile import ZipFile from zipfile import ZipFile
import requests import httpx
DOC = Path("/net/cubitus/projects/Partage_GEPETTO/Doc") DOC = Path("/net/cubitus/projects/Partage_GEPETTO/Doc")
GITLAB = "https://gitlab.laas.fr" GITLAB = "https://gitlab.laas.fr"
...@@ -17,11 +17,11 @@ if __name__ == "__main__": ...@@ -17,11 +17,11 @@ if __name__ == "__main__":
f.write(head.read()) f.write(head.read())
for project, namespace, branch in sorted( for project, namespace, branch in sorted(
requests.get(f"{RAINBOARD}/doc").json()["ret"] httpx.get(f"{RAINBOARD}/doc").json()["ret"]
): ):
url = f"{GITLAB}/{namespace}/{project}/-/jobs/artifacts/{branch}/download" url = f"{GITLAB}/{namespace}/{project}/-/jobs/artifacts/{branch}/download"
path = DOC / namespace / project / branch path = DOC / namespace / project / branch
r = requests.get(url, {"job": "doc-coverage"}, stream=True) r = httpx.get(url, {"job": "doc-coverage"}, stream=True)
try: try:
z = ZipFile(BytesIO(r.content)) z = ZipFile(BytesIO(r.content))
path.mkdir(parents=True, exist_ok=True) path.mkdir(parents=True, exist_ok=True)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment