Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def generate_prayers_complete():
"""Generate the `docs/prayers-complete.json` file."""
# Read in the item database content
path_to_prayers_json = Path(config.DOCS_PATH / "prayers-json")
all_db_prayers = prayers_api.all_prayers.AllPrayers(path_to_prayers_json)
prayers = {}
for prayer in all_db_prayers:
json_out = prayer.construct_json()
prayers[prayer.id] = json_out
# Save all prayers to docs/prayers-complete.json
out_fi = Path(config.DOCS_PATH / "prayers-complete.json")
with open(out_fi, "w") as f:
json.dump(prayers, f)
# Save all prayers to osrsbox/docs/prayers-complete.json
out_fi = Path(config.PACKAGE_PATH / "docs" / "prayers-complete.json")
with open(out_fi, "w") as f:
json.dump(prayers, f)