add logging calls to report progress

Show the files being generated by the candidate extension.

Change-Id: I672a8eaf5c6f4dc92ea85b8972f68f0c050a3708
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
Doug Hellmann 2018-11-06 08:42:22 -05:00
parent 79cc6c1db5
commit 04f5cfa9cd

View File

@ -22,8 +22,11 @@ from docutils import nodes
from docutils.parsers.rst import Directive from docutils.parsers.rst import Directive
from docutils.statemachine import ViewList from docutils.statemachine import ViewList
from openstack_election import utils from openstack_election import utils
from sphinx.util import logging
from sphinx.util.nodes import nested_parse_with_titles from sphinx.util.nodes import nested_parse_with_titles
LOG = logging.getLogger(__name__)
def render_template(template, data, **kwargs): def render_template(template, data, **kwargs):
template_dir = kwargs.get('template_dir', os.getcwd()) template_dir = kwargs.get('template_dir', os.getcwd())
@ -38,6 +41,7 @@ def render_list(list_type, candidates_list):
template_name = "%s.jinja" % list_type template_name = "%s.jinja" % list_type
template_dir = os.path.join(".", "doc", "source", "_exts") template_dir = os.path.join(".", "doc", "source", "_exts")
with open(output_file, "wb") as out: with open(output_file, "wb") as out:
LOG.info('writing list to %s', output_file)
out.write( out.write(
render_template( render_template(
template_name, template_name,
@ -69,6 +73,7 @@ def build_archive(serie, list_type):
template_name = "%s_archive.jinja" % list_type template_name = "%s_archive.jinja" % list_type
template_dir = os.path.join(".", "doc", "source", "_exts") template_dir = os.path.join(".", "doc", "source", "_exts")
with open(output, "wb") as out: with open(output, "wb") as out:
LOG.info('writing archive data to %s', output)
out.write( out.write(
render_template( render_template(
template_name, template_name,
@ -112,7 +117,9 @@ def build_lists(app):
if build_archive(previous, "tc"): if build_archive(previous, "tc"):
previous_toc.append(" results/%s/tc.rst" % previous) previous_toc.append(" results/%s/tc.rst" % previous)
toc = os.path.join(".", "doc", "source", "archive_toc.rst") toc = os.path.join(".", "doc", "source", "archive_toc.rst")
open(toc, "w").write("\n".join(previous_toc)) with open(toc, "w") as toc_fd:
LOG.info('writing TOC to %s', toc)
toc_fd.write("\n".join(previous_toc))
class CandidatesDirective(Directive): class CandidatesDirective(Directive):