mirror of
https://github.com/mustbeperfect/definitive-opensource.git
synced 2026-04-18 10:54:09 +02:00
Pointed script to new directory for data
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user