From c263859de68e0a5d36f1d01e01f76781cc93a143 Mon Sep 17 00:00:00 2001 From: SET Date: Wed, 12 Aug 2020 19:12:35 -0300 Subject: [PATCH] Made the "Total Compomponents" label coherent between HTML and XLSX --- kiplot/bom/html_writer.py | 2 +- kiplot/bom/xlsx_writer.py | 2 +- .../int_bom_simple_html_1.kiplot.yaml | 11 +++++++++++ .../int_bom_simple_html_2.kiplot.yaml | 12 ++++++++++++ .../int_bom_simple_html_3.kiplot.yaml | 12 ++++++++++++ .../int_bom_simple_html_4.kiplot.yaml | 13 +++++++++++++ .../int_bom_simple_html_5.kiplot.yaml | 14 ++++++++++++++ .../int_bom_simple_html_6.kiplot.yaml | 15 +++++++++++++++ 8 files changed, 79 insertions(+), 2 deletions(-) create mode 100644 tests/yaml_samples/int_bom_simple_html_1.kiplot.yaml create mode 100644 tests/yaml_samples/int_bom_simple_html_2.kiplot.yaml create mode 100644 tests/yaml_samples/int_bom_simple_html_3.kiplot.yaml create mode 100644 tests/yaml_samples/int_bom_simple_html_4.kiplot.yaml create mode 100644 tests/yaml_samples/int_bom_simple_html_5.kiplot.yaml create mode 100644 tests/yaml_samples/int_bom_simple_html_6.kiplot.yaml diff --git a/kiplot/bom/html_writer.py b/kiplot/bom/html_writer.py index 2edcdd14..a882e0aa 100644 --- a/kiplot/bom/html_writer.py +++ b/kiplot/bom/html_writer.py @@ -221,7 +221,7 @@ def write_html(filename, groups, headings, head_names, cfg): html.write(" Component Count: {} (per PCB)
\n\n".format(cfg.n_total)) html.write(" Fitted Components: {} (per PCB)
\n".format(cfg.n_fitted)) html.write(" Number of PCBs: {}
\n".format(cfg.number)) - html.write(" Total Component Count: {t} (for {n} PCBs)
\n".format(n=cfg.number, t=cfg.n_build)) + html.write(" Total Components: {t} (for {n} PCBs)
\n".format(n=cfg.number, t=cfg.n_build)) html.write(' \n') html.write('\n') html.write('\n') diff --git a/kiplot/bom/xlsx_writer.py b/kiplot/bom/xlsx_writer.py index fc489fb3..0fddc5ed 100644 --- a/kiplot/bom/xlsx_writer.py +++ b/kiplot/bom/xlsx_writer.py @@ -321,7 +321,7 @@ def write_xlsx(filename, groups, col_fields, head_names, cfg): rc = add_info(worksheet, column_widths, rc, col1, fmt_info, "Component Count:", cfg.n_total) rc = add_info(worksheet, column_widths, rc, col1, fmt_info, "Fitted Components:", cfg.n_fitted) rc = add_info(worksheet, column_widths, rc, col1, fmt_info, "Number of PCBs:", cfg.number) - rc = add_info(worksheet, column_widths, rc, col1, fmt_info, "Total components:", cfg.n_build) + rc = add_info(worksheet, column_widths, rc, col1, fmt_info, "Total Components:", cfg.n_build) # Adjust cols and rows adjust_widths(worksheet, column_widths, max_width) diff --git a/tests/yaml_samples/int_bom_simple_html_1.kiplot.yaml b/tests/yaml_samples/int_bom_simple_html_1.kiplot.yaml new file mode 100644 index 00000000..ff1159ba --- /dev/null +++ b/tests/yaml_samples/int_bom_simple_html_1.kiplot.yaml @@ -0,0 +1,11 @@ +# Example KiPlot config file +kiplot: + version: 1 + +outputs: + - name: 'bom_internal' + comment: "Bill of Materials in HTML format" + type: bom + dir: BoM + options: + format: HTML diff --git a/tests/yaml_samples/int_bom_simple_html_2.kiplot.yaml b/tests/yaml_samples/int_bom_simple_html_2.kiplot.yaml new file mode 100644 index 00000000..d9b63447 --- /dev/null +++ b/tests/yaml_samples/int_bom_simple_html_2.kiplot.yaml @@ -0,0 +1,12 @@ +# Example KiPlot config file +kiplot: + version: 1 + +outputs: + - name: 'bom_internal' + comment: "Bill of Materials in HTML format" + type: bom + dir: BoM + options: + html: + title: '' diff --git a/tests/yaml_samples/int_bom_simple_html_3.kiplot.yaml b/tests/yaml_samples/int_bom_simple_html_3.kiplot.yaml new file mode 100644 index 00000000..d9847018 --- /dev/null +++ b/tests/yaml_samples/int_bom_simple_html_3.kiplot.yaml @@ -0,0 +1,12 @@ +# Example KiPlot config file +kiplot: + version: 1 + +outputs: + - name: 'bom_internal' + comment: "Bill of Materials in HTML format" + type: bom + dir: BoM + options: + html: + logo: false diff --git a/tests/yaml_samples/int_bom_simple_html_4.kiplot.yaml b/tests/yaml_samples/int_bom_simple_html_4.kiplot.yaml new file mode 100644 index 00000000..6e1fb24b --- /dev/null +++ b/tests/yaml_samples/int_bom_simple_html_4.kiplot.yaml @@ -0,0 +1,13 @@ +# Example KiPlot config file +kiplot: + version: 1 + +outputs: + - name: 'bom_internal' + comment: "Bill of Materials in HTML format" + type: bom + dir: BoM + options: + html: + logo: false + title: '' diff --git a/tests/yaml_samples/int_bom_simple_html_5.kiplot.yaml b/tests/yaml_samples/int_bom_simple_html_5.kiplot.yaml new file mode 100644 index 00000000..e5eda7a4 --- /dev/null +++ b/tests/yaml_samples/int_bom_simple_html_5.kiplot.yaml @@ -0,0 +1,14 @@ +# Example KiPlot config file +kiplot: + version: 1 + +outputs: + - name: 'bom_internal' + comment: "Bill of Materials in HTML format" + type: bom + dir: BoM + options: + html: + logo: false + title: '' + hide_pcb_info: true diff --git a/tests/yaml_samples/int_bom_simple_html_6.kiplot.yaml b/tests/yaml_samples/int_bom_simple_html_6.kiplot.yaml new file mode 100644 index 00000000..c454e637 --- /dev/null +++ b/tests/yaml_samples/int_bom_simple_html_6.kiplot.yaml @@ -0,0 +1,15 @@ +# Example KiPlot config file +kiplot: + version: 1 + +outputs: + - name: 'bom_internal' + comment: "Bill of Materials in HTML format" + type: bom + dir: BoM + options: + html: + logo: false + title: '' + hide_pcb_info: true + hide_stats_info: true