mirror of
https://github.com/placeAtlas/atlas.git
synced 2024-05-29 01:25:10 +02:00
Implement per-entry patches 3
This commit is contained in:
parent
1c1662a837
commit
6ad26a1b27
|
@ -9,7 +9,7 @@
|
||||||
entry = None
|
entry = None
|
||||||
entry_input = ""
|
entry_input = ""
|
||||||
|
|
||||||
print("Write your submission entry here.")
|
print("Write/paste your JSON-formatted submission data here.")
|
||||||
while entry is None:
|
while entry is None:
|
||||||
|
|
||||||
entry_input += input("> ")
|
entry_input += input("> ")
|
||||||
|
@ -18,10 +18,10 @@
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
print()
|
print()
|
||||||
print("Entry received!")
|
print("Submission is valid!")
|
||||||
print()
|
print()
|
||||||
print("Enter your username as the attribution to be shown on the about page.")
|
print("Enter your username as the attribution to be shown on the About page.")
|
||||||
print("Leave it empty if you don't want to.")
|
print("Leave it empty if you don't want to be attributed.")
|
||||||
print("You can use your Reddit username. Do not include the \"u/\" part.")
|
print("You can use your Reddit username. Do not include the \"u/\" part.")
|
||||||
print("You can also your GitHub username, but add \"gh:\" before your username (e.g. \"gh:octocat\")")
|
print("You can also your GitHub username, but add \"gh:\" before your username (e.g. \"gh:octocat\")")
|
||||||
author = input("Author: ")
|
author = input("Author: ")
|
||||||
|
@ -29,8 +29,9 @@
|
||||||
if author:
|
if author:
|
||||||
entry['_author'] = author
|
entry['_author'] = author
|
||||||
|
|
||||||
|
filename = f'gh-{secrets.token_hex(2)}-{"-".join(entry["name"].split()).lower()}.json'
|
||||||
with open(f'{patches_dir}gh-{secrets.token_hex(2)}-{"-".join(entry["name"].split()).lower()}.json', 'w', encoding='utf-8') as out_file:
|
with open(f'{patches_dir}gh-{secrets.token_hex(2)}-{"-".join(entry["name"].split()).lower()}.json', 'w', encoding='utf-8') as out_file:
|
||||||
out_file.write(json.dumps(entry, ensure_ascii=False))
|
out_file.write(json.dumps(entry, ensure_ascii=False))
|
||||||
|
|
||||||
print("Patch created!")
|
print("Patch created as " + filename + "!")
|
||||||
print("You can commit this file directory, after that you can push and create a pull request.")
|
print("You can commit the created file directly, to which you can push and create a pull request after that.")
|
|
@ -18,16 +18,16 @@
|
||||||
with open('../web/atlas.json', 'r', encoding='utf-8') as atlas_file:
|
with open('../web/atlas.json', 'r', encoding='utf-8') as atlas_file:
|
||||||
atlas_data = json.loads(atlas_file.read())
|
atlas_data = json.loads(atlas_file.read())
|
||||||
|
|
||||||
# format_all_entries(atlas_file)
|
# format_all_entries(atlas_data)
|
||||||
|
|
||||||
# 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')
|
||||||
# scale_back.swap_source_dest('164', '165', os.path.join(base_image_path, '163_159.png'))
|
# scale_back.swap_source_dest('164', '165', os.path.join(base_image_path, '163_159.png'))
|
||||||
# scale_back.scale_back_entries(atlas_file)
|
# scale_back.scale_back_entries(atlas_data)
|
||||||
# scale_back.swap_source_dest('165', '166', os.path.join(base_image_path, '164_159.png'))
|
# scale_back.swap_source_dest('165', '166', os.path.join(base_image_path, '164_159.png'))
|
||||||
# scale_back.scale_back_entries(atlas_file)
|
# scale_back.scale_back_entries(atlas_data)
|
||||||
# scale_back.swap_source_dest('166', '167', os.path.join(base_image_path, '165_159.png'))
|
# scale_back.swap_source_dest('166', '167', os.path.join(base_image_path, '165_159.png'))
|
||||||
# scale_back.scale_back_entries(atlas_file)
|
# scale_back.scale_back_entries(atlas_data)
|
||||||
|
|
||||||
last_id = 0
|
last_id = 0
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue