Добавлеие вывода информации о включеных патчах

This commit is contained in:
2025-09-18 10:54:30 +03:00
parent 41399eca2c
commit 85aef3d997
2 changed files with 40 additions and 2 deletions
+17 -1
View File
@@ -11,9 +11,11 @@
},
"patches": {
"package_name": {
"enabled": true,
"new_package_name": "com.wowlikon.anixart"
},
"compress": {
"enabled": true,
"remove_language_files": true,
"remove_AI_voiceover": true,
"remove_debug_lines": true,
@@ -23,9 +25,11 @@
"compress_png_files": true
},
"change_server": {
"enabled": false,
"server": "https://anixarty.wowlikon.tech/modding"
},
"color_theme": {
"enabled": true,
"colors": {
"primary": "#ccff00",
"secondary": "#ffffd700",
@@ -39,12 +43,24 @@
}
},
"replace_navbar": {
"enabled": true,
"items": ["home", "discover", "feed", "bookmarks", "profile"]
},
"custom_speed": {
"speeds": [9.0]
"enabled": true,
"speeds": [0.0]
},
"disable_ad": {
"enabled": true
},
"disable_beta_banner": {
"enabled": true
},
"insert_new": {
"enabled": true
},
"settings_urls": {
"enabled": true,
"menu": {
"Мы в социальных сетях": [
{
+23 -1
View File
@@ -112,6 +112,28 @@ def init():
raise typer.Exit(1)
# ======================= INFO =========================
@app.command()
def info(patch_name: str = ""):
"""Вывод информации о патче"""
conf = load_config().model_dump()
if patch_name:
patch = Patch(patch_name, __import__(f"patcher.patches.{patch_name}"))
console.print(f"[green]Информация о патче {patch.name}:")
console.print(f" [yellow]Приоритет: {patch.priority}")
console.print(f" [yellow]Описание: {patch.module.__doc__}")
else:
console.print("[cyan]Список патчей:")
for f in PATCHES.glob("*.py"):
if f.name.startswith("todo_") or f.name == "__init__.py":
continue
name = f.stem
if conf['patches'].get(name,{}).get('enabled',True):
console.print(f" [yellow]{name}: [green]✔ enabled")
else:
console.print(f" [yellow]{name}: [red]✘ disabled")
# ======================= PATCHING =========================
class Patch:
def __init__(self, name: str, module):
@@ -232,7 +254,7 @@ def build(
continue
name = f.stem
settings = patch_settings.get(name, {})
if not settings.get("enable", True):
if not settings.get("enabled", True):
console.print(f"[yellow]≫ Пропускаем {name}")
continue
module = importlib.import_module(f"patches.{name}")