diff --git a/data/dynamic/applications.json b/core/data/dynamic/applications.json similarity index 100% rename from data/dynamic/applications.json rename to core/data/dynamic/applications.json diff --git a/data/dynamic/archive.json b/core/data/dynamic/archive.json similarity index 100% rename from data/dynamic/archive.json rename to core/data/dynamic/archive.json diff --git a/data/dynamic/backlog.json b/core/data/dynamic/backlog.json similarity index 100% rename from data/dynamic/backlog.json rename to core/data/dynamic/backlog.json diff --git a/data/static/categories.json b/core/data/static/categories.json similarity index 100% rename from data/static/categories.json rename to core/data/static/categories.json diff --git a/data/static/platforms.json b/core/data/static/platforms.json similarity index 100% rename from data/static/platforms.json rename to core/data/static/platforms.json diff --git a/data/static/project.json b/core/data/static/project.json similarity index 100% rename from data/static/project.json rename to core/data/static/project.json diff --git a/data/static/tags.json b/core/data/static/tags.json similarity index 100% rename from data/static/tags.json rename to core/data/static/tags.json diff --git a/core/source/generation/contents_generator.py b/core/source/generation/contents_generator.py index bdc93c8..601359c 100644 --- a/core/source/generation/contents_generator.py +++ b/core/source/generation/contents_generator.py @@ -41,13 +41,13 @@ def format_stars(n): def generate_contents(platform="all"): - with open("../../data/static/categories.json", "r", encoding="utf-8") as f: + with open("core/data/static/categories.json", "r", encoding="utf-8") as f: cat_data = json.load(f) - with open("../../data/dynamic/applications.json", "r", encoding="utf-8") as f: + with open("core/data/dynamic/applications.json", "r", encoding="utf-8") as f: app_data = json.load(f) - with open("../../data/static/tags.json", "r", encoding="utf-8") as f: + with open("core/data/static/tags.json", "r", encoding="utf-8") as f: tags_data = json.load(f) - with open("../../data/static/platforms.json", "r", encoding="utf-8") as f: + with open("core/data/static/platforms.json", "r", encoding="utf-8") as f: platforms_data = json.load(f) categories = cat_data.get("categories", []) diff --git a/core/source/generation/mainheader_generator.py b/core/source/generation/mainheader_generator.py index caf4b31..5d851c2 100644 --- a/core/source/generation/mainheader_generator.py +++ b/core/source/generation/mainheader_generator.py @@ -2,7 +2,7 @@ import json # Generates mainheader with dynamic project count def generate_mainheader(): - with open("../../data/dynamic/applications.json", "r", encoding="utf-8") as f: + with open("core/data/dynamic/applications.json", "r", encoding="utf-8") as f: data = json.load(f) project_count = len(data.get("applications", [])) diff --git a/core/source/maintenance/json_formatter.py b/core/source/maintenance/json_formatter.py index fffbc3e..d541da8 100644 --- a/core/source/maintenance/json_formatter.py +++ b/core/source/maintenance/json_formatter.py @@ -1,13 +1,13 @@ import json -with open("../../data/dynamic/applications.json") as f: +with open("core/data/dynamic/applications.json") as f: applications = json.load(f)["applications"] -with open("../../data/static/categories.json") as f: +with open("core/data/static/categories.json") as f: categories_data = json.load(f)["subcategories"] valid_categories = {c["id"].lower() for c in categories_data} -with open("../../data/static/platforms.json") as f: +with open("core/data/static/platforms.json") as f: platforms_data = json.load(f)["platforms"] valid_platforms = {p["id"].lower() for p in platforms_data} diff --git a/core/source/maintenance/stats_updator.py b/core/source/maintenance/stats_updator.py index 0c3c71d..938c3b9 100644 --- a/core/source/maintenance/stats_updator.py +++ b/core/source/maintenance/stats_updator.py @@ -4,7 +4,7 @@ import json from datetime import datetime import os -with open('../../data/dynamic/applications.json', 'r') as f: +with open('core/data/dynamic/applications.json', 'r') as f: data = json.load(f) GITHUB_TOKEN = os.getenv('GITHUB_TOKEN') @@ -57,7 +57,7 @@ def update_application_data(app): for app in data['applications']: app = update_application_data(app) -with open('../../data/dynamic/applications.json', 'w') as f: +with open('core/data/dynamic/applications.json', 'w') as f: json.dump(data, f, indent=4) print("Updated application data successfully!") diff --git a/core/source/maintenance/status_checker.py b/core/source/maintenance/status_checker.py index 62ec3f4..1c8b612 100644 --- a/core/source/maintenance/status_checker.py +++ b/core/source/maintenance/status_checker.py @@ -4,7 +4,7 @@ import json from datetime import datetime, timedelta import os -INPUT_FILE = "../../data/dynamic/applications.json" +INPUT_FILE = "core/data/dynamic/applications.json" OUTPUT_FILE = "resources/maintenance/status_maintenance.md" GITHUB_TOKEN = os.getenv("GITHUB_TOKEN") diff --git a/scripts/utils/contributing_autofill.py b/scripts/utils/contributing_autofill.py index 4713a65..6096e5d 100644 --- a/scripts/utils/contributing_autofill.py +++ b/scripts/utils/contributing_autofill.py @@ -391,7 +391,7 @@ def main() -> None: parser.add_argument( "--applications-file", default=str(APPLICATIONS_FILE), - help="Path to applications.json (default: ../../data/dynamic/applications.json).", + help="Path to applications.json (default: core/data/dynamic/applications.json).", ) parser.add_argument( "--full-details", diff --git a/scripts/utils/json_mod.py b/scripts/utils/json_mod.py index 63cbc48..f26f6bb 100644 --- a/scripts/utils/json_mod.py +++ b/scripts/utils/json_mod.py @@ -3,7 +3,7 @@ import json """ # Load the JSON data from file -with open("../../data/dynamic/applications.json", "r", encoding="utf-8") as file: +with open("core/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("../../data/dynamic/applications.json", "w", encoding="utf-8") as file: +with open("core/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("../../data/dynamic/applications.json", "r", encoding="utf-8") as file: +with open("core/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("../../data/dynamic/applications.json", "w", encoding="utf-8") as file: +with open("core/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("../../data/dynamic/applications.json", "r", encoding="utf-8") as f: +with open("core/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("../../data/dynamic/applications.json", "w", encoding="utf-8") as f: +with open("core/data/dynamic/applications.json", "w", encoding="utf-8") as f: json.dump(data, f, indent=4)