Updated confpy template and tool

This commit is contained in:
2023-04-18 08:30:44 +00:00
parent a7c75c7ee8
commit c597690ecd
2 changed files with 13 additions and 6 deletions

View File

@ -17,8 +17,12 @@
import os import os
import sys import sys
extensions = [ extensions = [
'otcdocstheme' 'otcdocstheme',
{%- if otc_sbv %}
'otc_sphinx_directives'
{%- endif %}
] ]
otcdocs_auto_name = False otcdocs_auto_name = False

View File

@ -164,10 +164,9 @@ def process_repositories(args, service):
title=f"{service['service_title']} - Service Based View", title=f"{service['service_title']} - Service Based View",
) )
copy_path = pathlib.Path(copy_to, 'doc', 'source') copy_path = pathlib.Path(copy_to, 'doc', 'source')
print(copy_path)
if not copy_path.exists(): if not copy_path.exists():
logging.info("Path for sbv does not exist") logging.info("Path for sbv does not exist")
copy_path.parent.mkdir(parents=True, exist_ok=True) copy_path.mkdir(parents=True, exist_ok=True)
context["otc_sbv"] = True context["otc_sbv"] = True
if git_fqdn: if git_fqdn:
context["git_fqdn"] = git_fqdn context["git_fqdn"] = git_fqdn
@ -180,8 +179,12 @@ def process_repositories(args, service):
logo_url="https://docs-int.otc-service.com", logo_url="https://docs-int.otc-service.com",
) )
conf_py_content = conf_py_template.render(**context) conf_py_content = conf_py_template.render(**context)
with open(pathlib.Path(copy_path, "conf.py"), "w", encoding="utf-8") as out: with open(
pathlib.Path(copy_path, "conf.py"),
"w",
encoding="utf-8") as out:
out.write(conf_py_content) out.write(conf_py_content)
repo_to.index.add(pathlib.Path(copy_path, "conf.py"))
if args.update_tox: if args.update_tox:
context = dict(docs=[]) context = dict(docs=[])
@ -294,8 +297,8 @@ def main():
parser.add_argument("--token", metavar="token", help="API token") parser.add_argument("--token", metavar="token", help="API token")
parser.add_argument("--api-url", help="API base url of the Git hoster") parser.add_argument("--api-url", help="API base url of the Git hoster")
parser.add_argument( parser.add_argument(
"--update_sbv", "--update-sbv",
action="store_true", action="store_true",
help="Whether to update service-based-view" help="Whether to update service-based-view"
) )