From 389bc4bdaa1451da4b92a17ad892d632bfc61d3d Mon Sep 17 00:00:00 2001 From: Sebastian Gode Date: Tue, 18 Apr 2023 11:49:25 +0000 Subject: [PATCH] Fix pep8 and placeholder --- tools/generate_doc_confpy.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tools/generate_doc_confpy.py b/tools/generate_doc_confpy.py index 0856a74f..ce29a8dc 100644 --- a/tools/generate_doc_confpy.py +++ b/tools/generate_doc_confpy.py @@ -181,7 +181,8 @@ def process_repositories(args, service): site_name="Internal Documentation Portal", logo_url="https://docs-int.otc-service.com", ) - sbv_title = (service["service_title"] + "\n" + ('=' * len(service["service_title"]))) + sbv_title = (service["service_title"] + "\n" + + ('=' * len(service["service_title"]))) context["sbv_title"] = sbv_title conf_py_content = conf_py_template.render(**context) index_sbv_content = index_sbv_template.render(**context) @@ -192,7 +193,8 @@ def process_repositories(args, service): out.write(conf_py_content) repo_to.index.add(pathlib.Path(copy_path, "conf.py")) - if not args.overwrite_index_sbv and pathlib.Path(copy_path, "index.rst").exists(): + if (not args.overwrite_index_sbv + and pathlib.Path(copy_path, "index.rst").exists()): logging.info("File index.rst for sbv exists. Skipping") else: with open( @@ -201,7 +203,11 @@ def process_repositories(args, service): encoding="utf-8") as out: out.write(index_sbv_content) repo_to.index.add(pathlib.Path(copy_path, "index.rst")) - + + placeholder_path = pathlib.Path(copy_path, "_static") + if not placeholder_path.exists(): + placeholder_path.mkdir(parents=True, exist_ok=True) + open(pathlib.Path(placeholder_path, ".placeholder"), 'a').close() if args.update_tox: context = dict(docs=[])