mirror of
https://github.com/placeAtlas/atlas.git
synced 2025-01-01 03:24:33 +01:00
Added permanent patch file
This commit is contained in:
parent
83fc486832
commit
cb88cc52d0
2 changed files with 12 additions and 3 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -9,7 +9,6 @@ temp.*
|
|||
temp-read-ids.txt
|
||||
allCharacters.txt
|
||||
combined.js
|
||||
data/patches
|
||||
|
||||
# Excluded files
|
||||
*.DS_Store
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
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 @@
|
|||
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 @@
|
|||
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()
|
||||
|
|
Loading…
Reference in a new issue