Pointed script to new directory for data

This commit is contained in:
Lucas
2026-01-01 21:49:36 -08:00
parent 5773a3e8c3
commit 58bd427b28
7 changed files with 18 additions and 18 deletions

View File

@@ -3,7 +3,7 @@ import json
"""
# Load the JSON data from file
with open("core/data/dynamic/applications.json", "r", encoding="utf-8") as file:
with open("../../data/dynamic/applications.json", "r", encoding="utf-8") as file:
data = json.load(file)
# Convert all platform entries to lowercase
@@ -12,7 +12,7 @@ for app in data.get("applications", []):
app["platforms"] = [platform.lower() for platform in app["platforms"]]
# Write the modified data back to the file
with open("core/data/dynamic/applications.json", "w", encoding="utf-8") as file:
with open("../../data/dynamic/applications.json", "w", encoding="utf-8") as file:
json.dump(data, file, indent=4)
print("All platform entries have been converted to lowercase.")
@@ -20,7 +20,7 @@ print("All platform entries have been converted to lowercase.")
"""
# Load the JSON file
with open("core/data/dynamic/applications.json", "r", encoding="utf-8") as file:
with open("../../data/dynamic/applications.json", "r", encoding="utf-8") as file:
data = json.load(file)
# Add "flags" and "stars" properties to each application
@@ -28,14 +28,14 @@ for app in data.get("applications", []):
app["homepage_url"] = ""
# Save the updated JSON back to the file
with open("core/data/dynamic/applications.json", "w", encoding="utf-8") as file:
with open("../../data/dynamic/applications.json", "w", encoding="utf-8") as file:
json.dump(data, file, indent=4, ensure_ascii=False)
print("Operation successful: applications.json updated")
"""
# Load applications.json
with open("core/data/dynamic/applications.json", "r", encoding="utf-8") as f:
with open("../../data/dynamic/applications.json", "r", encoding="utf-8") as f:
data = json.load(f)
# Platforms to check for
@@ -58,5 +58,5 @@ for app in data.get("applications", []):
app["tags"] = sorted(tags)
# Save the updated file
with open("core/data/dynamic/applications.json", "w", encoding="utf-8") as f:
with open("../../data/dynamic/applications.json", "w", encoding="utf-8") as f:
json.dump(data, f, indent=4)