主要更新内容:
- 更新修复说明文档,详细记录与原项目的差异
- 优化所有Python文件的代码风格(PEP 8规范)
- 优化所有Vue/JS文件的代码风格
- 添加测试目录和测试文件
- 删除过时的文档文件
🤖 Generated with CodeArts Agent
27 lines
1.0 KiB
Python
27 lines
1.0 KiB
Python
import requests
|
|
|
|
# api_url = "https://api.gitcode.com"
|
|
api_url = "https://api.github.com"
|
|
# public_token = "?access_token=y7S27_wDHXy1xaSQjupJk-Wy"
|
|
headers = {
|
|
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
|
|
"Accept": "application/json",
|
|
}
|
|
|
|
|
|
# 获取仓库的根目录
|
|
def get_main_warehouse():
|
|
# req_url = api_url + "/api/v5/repos/qq_27627297/WeiLin-Comfyui-Tools-Prompt/git/trees/master"+public_token
|
|
req_url = api_url + "/repos/weilin9999/WeiLin-Comfyui-Tools-Prompt/git/trees/master"
|
|
response = requests.get(req_url, headers=headers)
|
|
response.raise_for_status()
|
|
return response.json()
|
|
|
|
|
|
def get_warehouse_tree(path):
|
|
# req_url = api_url + "/api/v5/repos/qq_27627297/WeiLin-Comfyui-Tools-Prompt/contents/"+path+public_token
|
|
req_url = api_url + "/repos/weilin9999/WeiLin-Comfyui-Tools-Prompt/contents/" + path
|
|
response = requests.get(req_url, headers=headers)
|
|
response.raise_for_status()
|
|
return response.json()
|