feat(utils): readme updater tool

This commit is contained in:
Erica Marigold 2023-07-31 00:18:35 +05:30
parent e623832879
commit 55ac5dec0c
No known key found for this signature in database
GPG key ID: 23CD97ABBBCC5ED2
2 changed files with 34 additions and 10 deletions

View file

@ -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).
<details>
<summary>
Packaging Status
</summary>
</details>

34
utils/readme_update.py Normal file
View file

@ -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 = """<details>
<summary>
Packaging Status
</summary>
{}
</details>
""".format(generated_md_table)
print(generated_md_table)
if __name__ == "__main__":
main()