Run Black on make_readme.py
Signed-off-by: Nils VAN ZUIJLEN <nils.van-zuijlen@mailo.com>
This commit is contained in:
parent
6ec96be983
commit
cb54c92f42
1 changed files with 16 additions and 5 deletions
|
@ -17,7 +17,9 @@ def generate_READMEs(app_path):
|
||||||
upstream = manifest.get("upstream", {})
|
upstream = manifest.get("upstream", {})
|
||||||
|
|
||||||
if not upstream and not (app_path / "doc" / "DISCLAIMER.md").exists():
|
if not upstream and not (app_path / "doc" / "DISCLAIMER.md").exists():
|
||||||
print("There's no 'upstream' key in the manifest, and doc/DISCLAIMER.md doesn't exists - therefore assuming that we shall not auto-update the README.md for this app yet.")
|
print(
|
||||||
|
"There's no 'upstream' key in the manifest, and doc/DISCLAIMER.md doesn't exists - therefore assuming that we shall not auto-update the README.md for this app yet."
|
||||||
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
env = Environment(loader=FileSystemLoader(Path(__file__).parent / "templates"))
|
env = Environment(loader=FileSystemLoader(Path(__file__).parent / "templates"))
|
||||||
|
@ -41,14 +43,23 @@ def generate_READMEs(app_path):
|
||||||
else:
|
else:
|
||||||
disclaimer = None
|
disclaimer = None
|
||||||
|
|
||||||
out = template.render(lang=lang, upstream=upstream, screenshots=screenshots, disclaimer=disclaimer, manifest=manifest)
|
out = template.render(
|
||||||
|
lang=lang,
|
||||||
|
upstream=upstream,
|
||||||
|
screenshots=screenshots,
|
||||||
|
disclaimer=disclaimer,
|
||||||
|
manifest=manifest,
|
||||||
|
)
|
||||||
(app_path / f"README{lang_suffix}.md").write_text(out)
|
(app_path / f"README{lang_suffix}.md").write_text(out)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
parser = argparse.ArgumentParser(description='Automatically (re)generate README for apps')
|
parser = argparse.ArgumentParser(
|
||||||
parser.add_argument('app_path',
|
description="Automatically (re)generate README for apps"
|
||||||
help='Path to the app to generate/update READMEs for')
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"app_path", help="Path to the app to generate/update READMEs for"
|
||||||
|
)
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
generate_READMEs(Path(args.app_path))
|
generate_READMEs(Path(args.app_path))
|
||||||
|
|
Loading…
Reference in a new issue