20 lines
601 B
Python
20 lines
601 B
Python
"""Remove unnecessary files"""
|
|
priority = 0
|
|
from tqdm import tqdm
|
|
|
|
import os
|
|
import shutil
|
|
|
|
def apply(config: dict) -> bool:
|
|
for item in os.listdir("./decompiled/unknown/"):
|
|
item_path = os.path.join("./decompiled/unknown/", item)
|
|
|
|
if os.path.isfile(item_path):
|
|
os.remove(item_path)
|
|
tqdm.write(f'Удалён файл: {item_path}')
|
|
elif os.path.isdir(item_path):
|
|
if item not in config["cleanup"]["keep_dirs"]:
|
|
shutil.rmtree(item_path)
|
|
tqdm.write(f'Удалена папка: {item_path}')
|
|
return True
|