diff options
author | Tibor Frank <tifrank@cisco.com> | 2018-07-11 15:11:11 +0200 |
---|---|---|
committer | Tibor Frank <tifrank@cisco.com> | 2018-07-17 08:48:39 +0200 |
commit | cb66ecc82b7491823c837e2cefbf50984fcae594 (patch) | |
tree | b74193165967868d651b57cc001e3f6c411e394a /resources/tools | |
parent | 183c5f1c52fc03caa11bf70a17cc98d667dd07e3 (diff) |
CSIT-1094: Change menu style
Change-Id: Idff59bc73d3444700937fc473681760a947f0f41
Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'resources/tools')
-rw-r--r-- | resources/tools/presentation/conf.py | 2 | ||||
-rw-r--r-- | resources/tools/presentation/generator_report.py | 68 | ||||
-rw-r--r-- | resources/tools/presentation/pal.py | 6 | ||||
-rwxr-xr-x | resources/tools/presentation/run_report.sh | 1 |
4 files changed, 67 insertions, 10 deletions
diff --git a/resources/tools/presentation/conf.py b/resources/tools/presentation/conf.py index 78856302f3..32a6908d5c 100644 --- a/resources/tools/presentation/conf.py +++ b/resources/tools/presentation/conf.py @@ -45,7 +45,7 @@ source_suffix = ['.rst', '.md'] master_doc = 'index' # General information about the project. -project = u'FD.io CSIT' +project = u'FD.io CSIT rls1807 Report' copyright = u'2018, FD.io' author = u'FD.io CSIT' diff --git a/resources/tools/presentation/generator_report.py b/resources/tools/presentation/generator_report.py index 07103dbb1f..8e77ba7502 100644 --- a/resources/tools/presentation/generator_report.py +++ b/resources/tools/presentation/generator_report.py @@ -41,6 +41,49 @@ THEME_OVERRIDES = """/* override table width restrictions */ line-height: 18px; margin-bottom: 0px; } +.wy-menu-vertical a { + display: inline-block; + line-height: 18px; + padding: 0 2em; + display: block; + position: relative; + font-size: 90%; + color: #d9d9d9 +} +.wy-menu-vertical li.current a { + color: gray; + border-right: solid 1px #c9c9c9; + padding: 0 3em; +} +.wy-menu-vertical li.toctree-l2.current > a { + background: #c9c9c9; + padding: 0 3em; +} +.wy-menu-vertical li.toctree-l2.current li.toctree-l3 > a { + display: block; + background: #c9c9c9; + padding: 0 4em; +} +.wy-menu-vertical li.toctree-l3.current li.toctree-l4 > a { + display: block; + background: #bdbdbd; + padding: 0 5em; +} +.wy-menu-vertical li.on a, .wy-menu-vertical li.current > a { + color: #404040; + padding: 0 2em; + font-weight: bold; + position: relative; + background: #fcfcfc; + border: none; + border-top-width: medium; + border-bottom-width: medium; + border-top-style: none; + border-bottom-style: none; + border-top-color: currentcolor; + border-bottom-color: currentcolor; + padding-left: 2em -4px; +} """ # Command to build the html format of the report @@ -48,7 +91,7 @@ HTML_BUILDER = 'sphinx-build -v -c . -a ' \ '-b html -E ' \ '-t html ' \ '-D release={release} ' \ - '-D version="{release} report - {date}" ' \ + '-D version="Report v{report_version} - {date}" ' \ '{working_dir} ' \ '{build_dir}/' @@ -57,18 +100,20 @@ PDF_BUILDER = 'sphinx-build -v -c . -a ' \ '-b latex -E ' \ '-t latex ' \ '-D release={release} ' \ - '-D version="{release} report - {date}" ' \ + '-D version="Report v{report_version} - {date}" ' \ '{working_dir} ' \ '{build_dir}' -def generate_report(release, spec): +def generate_report(release, spec, report_version): """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. :type release: str :type spec: Specification + :type report_version: str """ logging.info("Generating the report ...") @@ -79,7 +124,7 @@ def generate_report(release, spec): } for report_format, versions in spec.output["format"].items(): - report[report_format](release, spec, versions) + report[report_format](release, spec, versions, report_version) archive_input_data(spec) archive_report(spec) @@ -87,15 +132,17 @@ def generate_report(release, spec): logging.info("Done.") -def generate_html_report(release, spec, versions): +def generate_html_report(release, spec, versions, report_version): """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. + :param report_version: Version of the report. :type release: str :type spec: Specification :type versions: list + :type report_version: str """ logging.info(" Generating the html report, give me a few minutes, please " @@ -103,6 +150,7 @@ def generate_html_report(release, spec, versions): cmd = HTML_BUILDER.format( release=release, + report_version=report_version, date=datetime.datetime.utcnow().strftime('%m/%d/%Y %H:%M UTC'), working_dir=spec.environment["paths"]["DIR[WORKING,SRC]"], build_dir=spec.environment["paths"]["DIR[BUILD,HTML]"]) @@ -119,15 +167,17 @@ def generate_html_report(release, spec, versions): logging.info(" Done.") -def generate_pdf_report(release, spec, versions): +def generate_pdf_report(release, spec, versions, report_version): """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. :type release: str :type spec: Specification :type versions: list + :type report_version: str """ logging.info(" Generating the pdf report, give me a few minutes, please " @@ -148,6 +198,7 @@ def generate_pdf_report(release, spec, versions): build_dir = spec.environment["paths"]["DIR[BUILD,LATEX]"] cmd = PDF_BUILDER.format( release=release, + report_version=report_version, date=datetime.datetime.utcnow().strftime('%m/%d/%Y %H:%M UTC'), working_dir=spec.environment["paths"]["DIR[WORKING,SRC]"], build_dir=build_dir) @@ -163,10 +214,11 @@ def generate_pdf_report(release, spec, versions): 'pdflatex -interaction nonstopmode csit.tex || true'. format(build_dir=build_dir), 'cd {build_dir} && ' - 'cp csit.pdf ../{archive_dir}/csit_{release}.pdf'. + 'cp csit.pdf ../{archive_dir}/csit_{release}_{report_version}.pdf'. format(build_dir=build_dir, archive_dir=archive_dir, - release=release) + release=release, + report_version=report_version) ] for cmd in cmds: diff --git a/resources/tools/presentation/pal.py b/resources/tools/presentation/pal.py index 013c921124..73d3b757aa 100644 --- a/resources/tools/presentation/pal.py +++ b/resources/tools/presentation/pal.py @@ -48,6 +48,10 @@ def parse_args(): default="master", type=str, help="Release string of the product.") + parser.add_argument("-v", "--version", + default="0.1", + type=str, + help="Version of the product.") parser.add_argument("-l", "--logging", choices=["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"], @@ -103,7 +107,7 @@ def main(): generate_files(spec, data) if spec.output["output"] == "report": - generate_report(args.release, spec) + generate_report(args.release, spec, args.version) logging.info("Successfully finished.") elif spec.output["output"] == "CPTA": sys.stdout.write(generate_cpta(spec, data)) diff --git a/resources/tools/presentation/run_report.sh b/resources/tools/presentation/run_report.sh index d294640fd1..8dcd17bbf9 100755 --- a/resources/tools/presentation/run_report.sh +++ b/resources/tools/presentation/run_report.sh @@ -38,6 +38,7 @@ export PYTHONPATH=`pwd` python pal.py \ --specification specification.yaml \ --release ${RELEASE} \ + --version "0.1" \ --logging INFO \ --force |