1
0
Fork 0
mirror of https://github.com/Radiquum/anixart-patcher.git synced 2025-09-06 11:13:51 +05:00

feat: initial commit

This commit is contained in:
Kentai Radiquum 2025-08-31 19:51:58 +05:00
commit b6c058c40f
Signed by: Radiquum
GPG key ID: 858E8EE696525EED
16 changed files with 400 additions and 0 deletions

25
patches/compress.py Normal file
View file

@ -0,0 +1,25 @@
"""Remove and Compress unnecessary resources"""
priority = 0
from tqdm import tqdm
import os
import shutil
from typing import TypedDict
class PatchConfig_Compress(TypedDict):
src: str
keep_dirs: list[str]
def apply(config: PatchConfig_Compress) -> bool:
for item in os.listdir(f"{config['src']}/unknown/"):
item_path = os.path.join(f"{config['src']}/unknown/", item)
if os.path.isfile(item_path):
os.remove(item_path)
tqdm.write(f"removed file: {item_path}")
elif os.path.isdir(item_path):
if item not in config["keep_dirs"]:
shutil.rmtree(item_path)
tqdm.write(f"removed directory: {item_path}")
return True