Musicreater/clean_update.py

25 lines
615 B
Python
Raw Normal View History

import shutil
import os
2023-04-29 21:28:36 +08:00
from rich.console import Console
from rich.progress import track
2023-04-29 21:28:36 +08:00
console = Console()
2023-04-29 21:28:36 +08:00
def main():
2024-05-01 01:16:05 +08:00
with console.status("寻众迹于 .egg-info 内"):
2023-04-29 21:28:36 +08:00
egg_info: list = []
for file in os.listdir():
2023-04-30 22:45:03 +08:00
if file.endswith(".egg-info"):
2023-04-29 21:28:36 +08:00
egg_info.append(file)
console.print(file)
2024-02-24 21:31:39 +08:00
for file in track(
2024-05-01 01:16:05 +08:00
["build", "dist", "logs", *egg_info], description="正删档"
2024-02-24 21:31:39 +08:00
):
2023-04-29 21:28:36 +08:00
if os.path.isdir(file) and os.access(file, os.W_OK):
shutil.rmtree(file)
2023-04-19 21:45:43 +08:00
2023-04-29 21:28:36 +08:00
if __name__ == "__main__":
main()