Обновление структуры проекта, использование pydantic для конфигураций, улучшение отчёта о патчах

This commit is contained in:
2025-10-01 23:07:37 +03:00
parent 5ba590cc31
commit fbc8b3e017
25 changed files with 406 additions and 315 deletions
+10 -3
View File
@@ -3,7 +3,7 @@
"change_server": {
"enabled": true,
"server": "https://anixarty.wowlikon.tech/modding"
"server": "https://anixarty.0x174.su/patch"
}
"""
@@ -13,11 +13,18 @@ priority = 0
import json
import requests
from tqdm import tqdm
from typing import Dict, Any
from pydantic import Field
from utils.config import PatchConfig
#Config
class Config(PatchConfig):
server: str = Field("https://anixarty.0x174.su/patch", description="URL сервера")
# Patch
def apply(config: dict) -> bool:
response = requests.get(config['server'])
def apply(config: Config, base: Dict[str, Any]) -> bool:
response = requests.get(config.server)
assert response.status_code == 200, f"Failed to fetch data {response.status_code} {response.text}"
new_api = json.loads(response.text)