From dbf88b714bf3b12335b3533c3a15db5d87aa2976 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B8=D0=BB=D0=B8=D0=BD=20=D0=9D=D0=B8=D0=BA?= =?UTF-8?q?=D0=B8=D1=82=D0=B0?= Date: Mon, 20 Apr 2026 17:41:15 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D1=84=D0=B0=D0=B9=D0=BB=20=D0=BD=D0=B0=20=D1=81=D0=BE?= =?UTF-8?q?=D0=B7=D0=B4=D0=B0=D0=BD=D0=B8=D0=B5=20=D1=80=D0=B5=D0=BF=D0=BE?= =?UTF-8?q?=D0=B7=D0=B8=D1=82=D0=BE=D1=80=D0=B8=D1=8F=20=D0=B8=20=D0=B1?= =?UTF-8?q?=D0=B8=D0=B1=D0=BB=D0=B8=D0=BE=D1=82=D0=B5=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 4 ++++ gitea_create_comment.py | 0 gitea_create_repo.py | 25 +++++++++++++++++++++++++ gitea_read.py | 2 +- requirements.txt | Bin 0 -> 188 bytes 5 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 gitea_create_comment.py create mode 100644 gitea_create_repo.py create mode 100644 requirements.txt diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8f0d76c --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.venv/ +__pycache__/ +*.pyc +.env \ No newline at end of file diff --git a/gitea_create_comment.py b/gitea_create_comment.py new file mode 100644 index 0000000..e69de29 diff --git a/gitea_create_repo.py b/gitea_create_repo.py new file mode 100644 index 0000000..d851410 --- /dev/null +++ b/gitea_create_repo.py @@ -0,0 +1,25 @@ +import os +import requests +from dotenv import load_dotenv + +load_dotenv() + +TOKEN = os.getenv("GITEA_WRITE_TOKEN") +BASE_URL = os.getenv("GITEA_BASE_URL", "https://git.vyatsu.ru") + +headers = { + "Authorization": f"token {TOKEN}", + "Content-Type": "application/json" +} + +data = { + "name": "third-work-network-python", + "description": "Третья работа по сетевым соединениям в Python", + "private": False, + "auto_init": True +} + +response = requests.post(f"{BASE_URL}/api/v1/user/repos", headers=headers, json=data) + +print("Статус:", response.status_code) +print(response.json()) \ No newline at end of file diff --git a/gitea_read.py b/gitea_read.py index d50f214..aba6dbc 100644 --- a/gitea_read.py +++ b/gitea_read.py @@ -11,7 +11,7 @@ headers = { "Authorization": f"token {TOKEN}" } -response = requests.get("https://git.vyatsu.ru/api/v1/user", headers=headers) +response = requests.get("https://git.vyatsu.ru/stud203989/2zadaniepraktiki/issues/1", headers=headers) print(response.status_code) print(response.json()) \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..4dfd184d0969e5fc67e6b8d0d53d90c50dc83926 GIT binary patch literal 188 zcmXYr+YW+23`FOdgimpUT;$1*0n|tW8d-Sp7>(>h(f*Dp!VX z3UpJYREavh)j&r0Sr>iuWg6KH`2L<^?gCGVYIpT|KsKIhFIURaCitHgdL%8L{|4L# SWy}IKczVnBxGeZxg=g%%OB{dz literal 0 HcmV?d00001