diff options
author | Tibor Frank <tifrank@cisco.com> | 2018-11-26 16:01:13 +0100 |
---|---|---|
committer | Tibor Frank <tifrank@cisco.com> | 2018-11-27 10:17:54 +0100 |
commit | 1077b448dd6c9397cfa5a3c2773ea4b8863f3016 (patch) | |
tree | 269a32f94ea7dd44b20fc8eea750ed3b32aad5ca /resources/tools/presentation/generator_report.py | |
parent | f8a74509fe70a49a6152293e4e5add0d24dc6d1a (diff) |
Report: versioning
Change-Id: I890d52b4b5b87cd1b3952b3d4bb3cbbff069a9c7
Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'resources/tools/presentation/generator_report.py')
-rw-r--r-- | resources/tools/presentation/generator_report.py | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/resources/tools/presentation/generator_report.py b/resources/tools/presentation/generator_report.py index a7b2d64af0..13ca75c1b9 100644 --- a/resources/tools/presentation/generator_report.py +++ b/resources/tools/presentation/generator_report.py @@ -105,15 +105,15 @@ PDF_BUILDER = 'sphinx-build -v -c . -a ' \ '{build_dir}' -def generate_report(release, spec, report_version): +def generate_report(release, spec, report_week): """Generate all formats and versions of the report. :param release: Release string of the product. :param spec: Specification read from the specification file. - :param report_version: Version of the report. + :param report_week: Calendar week when the report is published. :type release: str :type spec: Specification - :type report_version: str + :type report_week: str """ logging.info("Generating the report ...") @@ -124,7 +124,7 @@ def generate_report(release, spec, report_version): } for report_format, versions in spec.output["format"].items(): - report[report_format](release, spec, versions, report_version) + report[report_format](release, spec, versions, report_week) archive_input_data(spec) @@ -155,7 +155,6 @@ def generate_html_report(release, spec, versions, report_version): cmd = HTML_BUILDER.format( release=release, - report_version=report_version, date=datetime.datetime.utcnow().strftime('%Y-%m-%d %H:%M UTC'), working_dir=working_dir, build_dir=spec.environment["paths"]["DIR[BUILD,HTML]"]) @@ -172,17 +171,17 @@ def generate_html_report(release, spec, versions, report_version): logging.info(" Done.") -def generate_pdf_report(release, spec, versions, report_version): +def generate_pdf_report(release, spec, versions, report_week): """Generate html format of the report. :param release: Release string of the product. :param spec: Specification read from the specification file. :param versions: List of versions to generate. Not implemented yet. - :param report_version: Version of the report. + :param report_week: Calendar week when the report is published. :type release: str :type spec: Specification :type versions: list - :type report_version: str + :type report_week: str """ logging.info(" Generating the pdf report, give me a few minutes, please " @@ -210,7 +209,6 @@ def generate_pdf_report(release, spec, versions, report_version): build_dir = spec.environment["paths"]["DIR[BUILD,LATEX]"] cmd = PDF_BUILDER.format( release=release, - report_version=report_version, date=datetime.datetime.utcnow().strftime('%Y-%m-%d %H:%M UTC'), working_dir=working_dir, build_dir=build_dir) @@ -226,12 +224,12 @@ def generate_pdf_report(release, spec, versions, report_version): 'pdflatex -interaction nonstopmode csit.tex || true'. format(build_dir=build_dir), 'cd {build_dir} && ' - 'cp csit.pdf ../{archive_dir}/csit_{release}_{report_version}.pdf &&' + 'cp csit.pdf ../{archive_dir}/csit_{release}.{week}.pdf &&' 'cp csit.pdf ../{archive_dir}/csit_{release}.pdf'. format(build_dir=build_dir, archive_dir=archive_dir, release=release, - report_version=report_version) + week=report_week) ] for cmd in cmds: |