Added permanent patch file

This commit is contained in:
AnonymousRandomPerson 2023-06-23 15:30:57 -05:00
parent 83fc486832
commit cb88cc52d0
2 changed files with 12 additions and 3 deletions

1
.gitignore vendored
View File

@ -9,7 +9,6 @@ temp.*
temp-read-ids.txt
allCharacters.txt
combined.js
data/patches
# Excluded files
*.DS_Store

View File

@ -27,6 +27,7 @@ for i, entry in enumerate(atlas_data):
last_id = int(id)
patches_dir = "../data/patches/"
permanent_patch_file = "temp-atlas.json"
if not os.path.exists(patches_dir):
print("Patches folder not found. Exiting.")
exit()
@ -34,8 +35,14 @@ if not os.path.exists(patches_dir):
base_image_path = os.path.join('..', 'web', '_img', 'canvas', 'place30')
ScaleConfig.image1 = os.path.join(base_image_path, '159.png')
for filename in os.listdir(patches_dir):
f = os.path.join(patches_dir, filename)
filenames = os.listdir(patches_dir)
filenames.append(permanent_patch_file)
for filename in filenames:
if filename == permanent_patch_file:
f = filename
else:
f = os.path.join(patches_dir, filename)
print(f"{filename}: Processing...")
@ -93,6 +100,9 @@ for filename in os.listdir(patches_dir):
print(f"{filename}: Added {entry['id']}.")
atlas_data.append(entry)
if filename != permanent_patch_file:
os.remove(f)
except:
print(f"{filename}: Something went wrong; patch couldn't be implemented. Skipping.")
traceback.print_exc()