mirror of
https://github.com/placeAtlas/atlas.git
synced 2025-01-03 23:53:42 +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
|
temp-read-ids.txt
|
||||||
allCharacters.txt
|
allCharacters.txt
|
||||||
combined.js
|
combined.js
|
||||||
data/patches
|
|
||||||
|
|
||||||
# Excluded files
|
# Excluded files
|
||||||
*.DS_Store
|
*.DS_Store
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
last_id = int(id)
|
last_id = int(id)
|
||||||
|
|
||||||
patches_dir = "../data/patches/"
|
patches_dir = "../data/patches/"
|
||||||
|
permanent_patch_file = "temp-atlas.json"
|
||||||
if not os.path.exists(patches_dir):
|
if not os.path.exists(patches_dir):
|
||||||
print("Patches folder not found. Exiting.")
|
print("Patches folder not found. Exiting.")
|
||||||
exit()
|
exit()
|
||||||
|
@ -34,8 +35,14 @@
|
||||||
base_image_path = os.path.join('..', 'web', '_img', 'canvas', 'place30')
|
base_image_path = os.path.join('..', 'web', '_img', 'canvas', 'place30')
|
||||||
ScaleConfig.image1 = os.path.join(base_image_path, '159.png')
|
ScaleConfig.image1 = os.path.join(base_image_path, '159.png')
|
||||||
|
|
||||||
for filename in os.listdir(patches_dir):
|
filenames = os.listdir(patches_dir)
|
||||||
f = os.path.join(patches_dir, filename)
|
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...")
|
print(f"{filename}: Processing...")
|
||||||
|
|
||||||
|
@ -93,6 +100,9 @@
|
||||||
print(f"{filename}: Added {entry['id']}.")
|
print(f"{filename}: Added {entry['id']}.")
|
||||||
atlas_data.append(entry)
|
atlas_data.append(entry)
|
||||||
|
|
||||||
|
if filename != permanent_patch_file:
|
||||||
|
os.remove(f)
|
||||||
|
|
||||||
except:
|
except:
|
||||||
print(f"{filename}: Something went wrong; patch couldn't be implemented. Skipping.")
|
print(f"{filename}: Something went wrong; patch couldn't be implemented. Skipping.")
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
|
|
Loading…
Reference in a new issue