diff --git a/.gitignore b/.gitignore index 6c9112c..a5726b6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ /* *.DS_Store +*.py + !.gitignore !/Translated diff --git a/NeedTranslate/gpt-o4.py b/NeedTranslate/gpt-o4.py deleted file mode 100644 index b8d98d7..0000000 --- a/NeedTranslate/gpt-o4.py +++ /dev/null @@ -1,29 +0,0 @@ -import os -import shutil -import re - -ch4F = "./ch4" -files = os.listdir(ch4F) -prefixes = {f[:-6] for f in files if f.endswith("_1.png")} - -for prefix in prefixes: - dest_dir = os.path.join(ch4F, prefix) - os.makedirs(dest_dir, exist_ok=True) - for fname in list(files): - if fname.startswith(prefix + "_") or fname == f"{prefix}.png": - shutil.move(os.path.join(ch4F, fname), - os.path.join(dest_dir, fname)) - files = os.listdir(ch4F) - -pattern0 = re.compile(r"^(.+)_0\.png$") -for fname in files: - m = pattern0.match(fname) - if not m: - continue - prefix = m.group(1) - variants = [f for f in files if f.startswith(prefix + "_") and f != fname] - if not variants: - src = os.path.join(ch4F, fname) - dst = os.path.join(ch4F, f"{prefix}.png") - os.rename(src, dst) - files = os.listdir(ch4F) \ No newline at end of file diff --git a/NeedTranslate/rename.py b/NeedTranslate/rename.py deleted file mode 100644 index 379cc95..0000000 --- a/NeedTranslate/rename.py +++ /dev/null @@ -1,25 +0,0 @@ -import os -import shutil - -ch4F = "./ch4" -files = os.listdir(ch4F) - -os.mkdir(f"{ch4F}/TEMPwo0") - -for sprite in files: - if ".png" in sprite and sprite and f"{sprite[:-6]}_1.png" in files: - if "TEMP" not in files: - os.mkdir(f"{ch4F}/TEMP") - for finds in files: - if sprite[:-6] in finds and sprite in files: - shutil.move(f"{ch4F}/{finds}", f"{ch4F}/TEMP/{finds}") - os.rename(f"{ch4F}/TEMP", f"{ch4F}/{sprite[:-6]}") - else: - shutil.move(f"{ch4F}/{sprite}", f"{ch4F}/TEMPwo0/{sprite}") - os.rename(f"{ch4F}/TEMPwo0/{sprite}", f"{ch4F}/TEMPwo0/{sprite[:-6]}.png") - files = os.listdir(ch4F) - -shutil.move(f"{ch4F}/TEMPwo0", f"{ch4F}") -os.remove(f"{ch4F}/TEMPwo0") - -print(files) \ No newline at end of file