Обновление структуры проекта, использование pydantic для конфигураций, улучшение отчёта о патчах
Build mod / build (push) Successful in 6m39s
Build mod / build (push) Successful in 6m39s
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user