From 55ac5dec0cc15fcd05743c6b3f61d0eef5d260de Mon Sep 17 00:00:00 2001 From: Compey Date: Mon, 31 Jul 2023 00:18:35 +0530 Subject: [PATCH] feat(utils): readme updater tool --- README.md | 10 ---------- utils/readme_update.py | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 10 deletions(-) create mode 100644 utils/readme_update.py diff --git a/README.md b/README.md index 86932ed..e69de29 100644 --- a/README.md +++ b/README.md @@ -1,10 +0,0 @@ -This repository houses the require manifests and build scripts for lune packaging. For more information on lune, -see [filiptibell/lune](https://github.com/filiptibell/lune). - -
- - Packaging Status - - - -
diff --git a/utils/readme_update.py b/utils/readme_update.py new file mode 100644 index 0000000..7f877e8 --- /dev/null +++ b/utils/readme_update.py @@ -0,0 +1,34 @@ +from platform import platform +import tomllib as toml + +README_HEADER = """This repository houses the require manifests and build scripts for lune packaging. For more information on lune, see [filiptibell/lune](https://github.com/filiptibell/lune). +""" +MARKDOWN_TABLE_HEADER = """| Package Registry | Status | +|------|------| +""" + +__VERSION__ = f"v0.1.0-{platform()}" + +def main(): + print('running readme_updater ', __VERSION__) + with open("status.toml", 'rb') as status_file: + packaging_statuses = toml.load(status_file) + + generated_md_table = MARKDOWN_TABLE_HEADER + "" + + for package, status in packaging_statuses.items(): + generated_md_table += f"{package} | {status}" + + updated_readme = """
+ + Packaging Status + + {} +
+ """.format(generated_md_table) + + print(generated_md_table) + + +if __name__ == "__main__": + main()