From 366a72272541ab5ed288c19652b7a11ca5790748 Mon Sep 17 00:00:00 2001 From: alexzvk Date: Mon, 28 Nov 2022 17:05:51 -0500 Subject: [PATCH] adjusted json, dict errors --- licenses.json | 48 +++++++++++++++++++++++++++++++++++++- scripts/update_licenses.py | 4 ++-- 2 files changed, 49 insertions(+), 3 deletions(-) diff --git a/licenses.json b/licenses.json index aa50ecd2..8314dcb9 100644 --- a/licenses.json +++ b/licenses.json @@ -1 +1,47 @@ -{"BSD Zero Clause License": "0bsd.txt", "Academic Free License v3.0": "afl-3.0.txt", "GNU Affero General Public License v3.0": "agpl-3.0.txt", "Apache License 2.0": "apache-2.0.txt", "Artistic License 2.0": "artistic-2.0.txt", "BSD 2-Clause \"Simplified\" License": "bsd-2-clause.txt", "BSD 3-Clause Clear License": "bsd-3-clause-clear.txt", "BSD 3-Clause \"New\" or \"Revised\" License": "bsd-3-clause.txt", "BSD 4-Clause \"Original\" or \"Old\" License": "bsd-4-clause.txt", "Boost Software License 1.0": "bsl-1.0.txt", "Creative Commons Attribution 4.0 International": "cc-by-4.0.txt", "Creative Commons Attribution Share Alike 4.0 International": "cc-by-sa-4.0.txt", "Creative Commons Zero v1.0 Universal": "cc0-1.0.txt", "CeCILL Free Software License Agreement v2.1": "cecill-2.1.txt", "CERN Open Hardware Licence Version 2 - Permissive": "cern-ohl-p-2.0.txt", "CERN Open Hardware Licence Version 2 - Strongly Reciprocal": "cern-ohl-s-2.0.txt", "CERN Open Hardware Licence Version 2 - Weakly Reciprocal": "cern-ohl-w-2.0.txt", "Educational Community License v2.0": "ecl-2.0.txt", "Eclipse Public License 1.0": "epl-1.0.txt", "Eclipse Public License 2.0": "epl-2.0.txt", "European Union Public License 1.1": "eupl-1.1.txt", "European Union Public License 1.2": "eupl-1.2.txt", "GNU Free Documentation License v1.3": "gfdl-1.3.txt", "GNU General Public License v2.0": "gpl-2.0.txt", "GNU General Public License v3.0": "gpl-3.0.txt", "ISC License": "isc.txt", "GNU Lesser General Public License v2.1": "lgpl-2.1.txt", "GNU Lesser General Public License v3.0": "lgpl-3.0.txt", "LaTeX Project Public License v1.3c": "lppl-1.3c.txt", "MIT No Attribution": "mit-0.txt", "MIT License": "mit.txt", "Mozilla Public License 2.0": "mpl-2.0.txt", "Microsoft Public License": "ms-pl.txt", "Microsoft Reciprocal License": "ms-rl.txt", "Mulan Permissive Software License, Version 2": "mulanpsl-2.0.txt", "University of Illinois/NCSA Open Source License": "ncsa.txt", "Open Data Commons Open Database License v1.0": "odbl-1.0.txt", "SIL Open Font License 1.1": "ofl-1.1.txt", "Open Software License 3.0": "osl-3.0.txt", "PostgreSQL License": "postgresql.txt", "The Unlicense": "unlicense.txt", "Universal Permissive License v1.0": "upl-1.0.txt", "Vim License": "vim.txt", "\"Do What The F*ck You Want To Public License\"": "wtfpl.txt", "zlib License": "zlib.txt"} \ No newline at end of file +{ + "BSD Zero Clause License": "0bsd.txt", + "Academic Free License v3.0": "afl-3.0.txt", + "GNU Affero General Public License v3.0": "agpl-3.0.txt", + "Apache License 2.0": "apache-2.0.txt", + "Artistic License 2.0": "artistic-2.0.txt", + "BSD 2-Clause \"Simplified\" License": "bsd-2-clause.txt", + "BSD 3-Clause Clear License": "bsd-3-clause-clear.txt", + "BSD 3-Clause \"New\" or \"Revised\" License": "bsd-3-clause.txt", + "BSD 4-Clause \"Original\" or \"Old\" License": "bsd-4-clause.txt", + "Boost Software License 1.0": "bsl-1.0.txt", + "Creative Commons Attribution 4.0 International": "cc-by-4.0.txt", + "Creative Commons Attribution Share Alike 4.0 International": "cc-by-sa-4.0.txt", + "Creative Commons Zero v1.0 Universal": "cc0-1.0.txt", + "CeCILL Free Software License Agreement v2.1": "cecill-2.1.txt", + "CERN Open Hardware Licence Version 2 - Permissive": "cern-ohl-p-2.0.txt", + "CERN Open Hardware Licence Version 2 - Strongly Reciprocal": "cern-ohl-s-2.0.txt", + "CERN Open Hardware Licence Version 2 - Weakly Reciprocal": "cern-ohl-w-2.0.txt", + "Educational Community License v2.0": "ecl-2.0.txt", + "Eclipse Public License 1.0": "epl-1.0.txt", + "Eclipse Public License 2.0": "epl-2.0.txt", + "European Union Public License 1.1": "eupl-1.1.txt", + "European Union Public License 1.2": "eupl-1.2.txt", + "GNU Free Documentation License v1.3": "gfdl-1.3.txt", + "GNU General Public License v2.0": "gpl-2.0.txt", + "GNU General Public License v3.0": "gpl-3.0.txt", + "ISC License": "isc.txt", + "GNU Lesser General Public License v2.1": "lgpl-2.1.txt", + "GNU Lesser General Public License v3.0": "lgpl-3.0.txt", + "LaTeX Project Public License v1.3c": "lppl-1.3c.txt", + "MIT No Attribution": "mit-0.txt", + "MIT License": "mit.txt", + "Mozilla Public License 2.0": "mpl-2.0.txt", + "Microsoft Public License": "ms-pl.txt", + "Microsoft Reciprocal License": "ms-rl.txt", + "Mulan Permissive Software License, Version 2": "mulanpsl-2.0.txt", + "University of Illinois/NCSA Open Source License": "ncsa.txt", + "Open Data Commons Open Database License v1.0": "odbl-1.0.txt", + "SIL Open Font License 1.1": "ofl-1.1.txt", + "Open Software License 3.0": "osl-3.0.txt", + "PostgreSQL License": "postgresql.txt", + "The Unlicense": "unlicense.txt", + "Universal Permissive License v1.0": "upl-1.0.txt", + "Vim License": "vim.txt", + "\"Do What The F*ck You Want To Public License\"": "wtfpl.txt", + "zlib License": "zlib.txt" +} \ No newline at end of file diff --git a/scripts/update_licenses.py b/scripts/update_licenses.py index f22927f0..66146e11 100644 --- a/scripts/update_licenses.py +++ b/scripts/update_licenses.py @@ -8,12 +8,12 @@ from github import Github CURRENT_FILE = Path(__file__) ROOT = CURRENT_FILE.parents[1] GITHUB_TOKEN = os.getenv("GITHUB_TOKEN", None) -GITHUB_TOKEN = "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" def main() -> None: """ Script entry point. """ + titles_dict = {} repo = Github(login_or_token=GITHUB_TOKEN).get_repo("github/choosealicense.com") license_dir = ROOT / "{{cookiecutter.project_slug}}" / "licenses" license_dir.mkdir(exist_ok=True) @@ -29,7 +29,7 @@ def main() -> None: # write the titles dictionary to a json file and put it in workflows so it can be accessed by other files with open('licenses.json', 'w') as licenses_dict: - licenses_dict.write(json.dumps(titles_dict)) + json.dump(titles_dict, licenses_dict, indent=2) # Put "Not open source" at front so people know it's an option front_options = [ "Not open source",