From a0f57d684663509cab1631f574f96cc2b9bbcf47 Mon Sep 17 00:00:00 2001 From: Graham Keeth Date: Sun, 7 Mar 2021 16:33:59 +0000 Subject: [PATCH] Cleanup BOM script descriptions - make descriptions consistent - fix inaccuracies - describe what scripts do more precisely --- .../bom_csv_grouped_by_value.py | 11 ++++++---- .../bom_csv_grouped_by_value_with_fp.py | 8 +++---- .../python_scripts/bom_csv_sorted_by_ref.py | 9 ++++---- .../bom_html_grouped_by_value.py | 9 ++++---- .../bom_html_with_advanced_grouping.py | 11 +++++----- ...ted_by_ref.py => bom_txt_sorted_by_ref.py} | 13 +++++------ eeschema/plugins/xsl_scripts/bom2csv.xsl | 22 +++++-------------- .../plugins/xsl_scripts/bom2grouped_csv.xsl | 21 +++++++----------- .../bom_with_title_block_2_csv.xsl | 13 ++++++----- 9 files changed, 53 insertions(+), 64 deletions(-) rename eeschema/plugins/python_scripts/{bom_sorted_by_ref.py => bom_txt_sorted_by_ref.py} (85%) diff --git a/eeschema/plugins/python_scripts/bom_csv_grouped_by_value.py b/eeschema/plugins/python_scripts/bom_csv_grouped_by_value.py index b582d6190d..5450b9e372 100644 --- a/eeschema/plugins/python_scripts/bom_csv_grouped_by_value.py +++ b/eeschema/plugins/python_scripts/bom_csv_grouped_by_value.py @@ -3,12 +3,15 @@ # # Example: Sorted and Grouped CSV BOM # + """ @package - Generate a csv BOM list. - Components are sorted by ref and grouped by value - Fields are (if exist) - Item, Qty, Reference(s), Value, LibPart, Footprint, Datasheet + Output: CSV (comma-separated) + Grouped By: Value + Sorted By: Ref + Fields: Item, Qty, Reference(s), Value, LibPart, Footprint, Datasheet, all additional symbol fields + + Outputs ungrouped components first, then outputs grouped components. Command line: python "pathToFile/bom_csv_grouped_by_value.py" "%I" "%O.csv" diff --git a/eeschema/plugins/python_scripts/bom_csv_grouped_by_value_with_fp.py b/eeschema/plugins/python_scripts/bom_csv_grouped_by_value_with_fp.py index 37db33a046..87052c0d12 100644 --- a/eeschema/plugins/python_scripts/bom_csv_grouped_by_value_with_fp.py +++ b/eeschema/plugins/python_scripts/bom_csv_grouped_by_value_with_fp.py @@ -6,10 +6,10 @@ """ @package - Generate a comma delimited list (csv file type). - Components are sorted by ref and grouped by value with same footprint - Fields are (if exist) - 'Ref', 'Qnty', 'Value', 'Cmp name', 'Footprint', 'Description', 'Vendor' + Output: CSV (comma-separated) + Grouped By: Value, Footprint + Sorted By: Ref + Fields: Ref, Qnty, Value, Cmp name, Footprint, Description, Vendor Command line: python "pathToFile/bom_csv_grouped_by_value_with_fp.py" "%I" "%O.csv" diff --git a/eeschema/plugins/python_scripts/bom_csv_sorted_by_ref.py b/eeschema/plugins/python_scripts/bom_csv_sorted_by_ref.py index e66cc132a1..d51076c7ba 100644 --- a/eeschema/plugins/python_scripts/bom_csv_sorted_by_ref.py +++ b/eeschema/plugins/python_scripts/bom_csv_sorted_by_ref.py @@ -6,11 +6,10 @@ """ @package - Generate a csv list file. - Components are sorted by ref - One component per line - Fields are (if exist) - Ref, value, Part, footprint, Datasheet, Manufacturer, Vendor + Output: CSV (comma-separated) + Grouped By: ungrouped, one component per line + Sorted By: Ref + Fields: Ref, Value, Part, Footprint, Datasheet, Manufacturer, Vendor Command line: python "pathToFile/bom_csv_sorted_by_ref.py" "%I" "%O.csv" diff --git a/eeschema/plugins/python_scripts/bom_html_grouped_by_value.py b/eeschema/plugins/python_scripts/bom_html_grouped_by_value.py index 80def66453..eae2689940 100644 --- a/eeschema/plugins/python_scripts/bom_html_grouped_by_value.py +++ b/eeschema/plugins/python_scripts/bom_html_grouped_by_value.py @@ -3,12 +3,13 @@ # # Example: Sorted and Grouped HTML BOM # + """ @package - Generate a HTML BOM list. - Components are sorted by ref and grouped by value - Fields are (if exist) - Ref, Quantity, Value, Part, Datasheet, Description, Vendor + Output: HTML + Grouped By: Value + Sorted By: Ref + Fields: Ref, Qnty, Value, Part, Datasheet, Description, Vendor Command line: python "pathToFile/bom_html_grouped_by_value.py" "%I" "%O.html" diff --git a/eeschema/plugins/python_scripts/bom_html_with_advanced_grouping.py b/eeschema/plugins/python_scripts/bom_html_with_advanced_grouping.py index a091351509..0a149598b0 100644 --- a/eeschema/plugins/python_scripts/bom_html_with_advanced_grouping.py +++ b/eeschema/plugins/python_scripts/bom_html_with_advanced_grouping.py @@ -6,16 +6,15 @@ """ @package - Generate a HTML BOM list. - Components are sorted and grouped by value - Fields are (if exist) - Ref, Quantity, Value, Part, Footprint, Description, Vendor + Output: HTML + Grouped By: Value, Part, Footprint, Tolerance, Manufacturer, Voltage + Sorted By: Ref + Fields: Ref, Qnty, Value, Part, Footprint, Description, Vendor Command line: python "pathToFile/bom_with_advanced_grouping.py" "%I" "%O.html" """ - from __future__ import print_function # Import the KiCad python helper module and the csv formatter @@ -79,7 +78,7 @@ kicad_netlist_reader.comp.__eq__ = myEqu # .tmp. If the file doesn't exist, execution will stop net = kicad_netlist_reader.netlist(sys.argv[1]) -# Open a file to write too, if the file cannot be opened output to stdout +# Open a file to write to, if the file cannot be opened output to stdout # instead try: f = open(sys.argv[2], 'w') diff --git a/eeschema/plugins/python_scripts/bom_sorted_by_ref.py b/eeschema/plugins/python_scripts/bom_txt_sorted_by_ref.py similarity index 85% rename from eeschema/plugins/python_scripts/bom_sorted_by_ref.py rename to eeschema/plugins/python_scripts/bom_txt_sorted_by_ref.py index aa74dfb19b..bbf08cb9db 100644 --- a/eeschema/plugins/python_scripts/bom_sorted_by_ref.py +++ b/eeschema/plugins/python_scripts/bom_txt_sorted_by_ref.py @@ -1,17 +1,16 @@ # # Example python script to generate a BOM from a KiCad generic netlist # + """ @package - Generate a BOM list file (a simple text). - Components are sorted by ref - One component per line - Fields are (if exist) - Ref, Quantity, value, Part, footprint, Description, Vendor - Fields are separated by tabs + Output: text file (tab-separated) + Grouped By: ungrouped, one component per line + Sorted By: Ref + Fields: Ref, Value, Part, Footprint, Description, Vendor Command line: - python "pathToFile/bom_sorted_by_ref.py" "%I" "%O.txt" + python "pathToFile/bom_txt_sorted_by_ref.py" "%I" "%O.txt" """ from __future__ import print_function diff --git a/eeschema/plugins/xsl_scripts/bom2csv.xsl b/eeschema/plugins/xsl_scripts/bom2csv.xsl index 67d588b381..c515135f97 100644 --- a/eeschema/plugins/xsl_scripts/bom2csv.xsl +++ b/eeschema/plugins/xsl_scripts/bom2csv.xsl @@ -6,27 +6,17 @@ Generation of csv table with table head of all existing field names and correct assigned cell entries - How to use this is explained in eeschema.pdf chapter 14. You enter a command line into the - netlist exporter using a new (custom) tab in the netlist export dialog. The command is - similar to - on Windows: - xsltproc -o "%O.csv" "C:\Program Files (x86)\KiCad\bin\plugins\bom2csv.xsl" "%I" - on Linux: - xsltproc -o "%O.csv" /usr/local/lib/kicad/plugins/bom2csv.xsl "%I" - - Instead of "%O.csv" you can alternatively use "%O" if you will supply your own file extension when - prompted in the UI. The double quotes are there to account for the possibility of space(s) - in the filename. + How to use this is explained in eeschema.pdf chapter 14. --> diff --git a/eeschema/plugins/xsl_scripts/bom2grouped_csv.xsl b/eeschema/plugins/xsl_scripts/bom2grouped_csv.xsl index 9427c46853..3656048636 100644 --- a/eeschema/plugins/xsl_scripts/bom2grouped_csv.xsl +++ b/eeschema/plugins/xsl_scripts/bom2grouped_csv.xsl @@ -7,22 +7,17 @@ Functionality: Generation of Digi-Key ordering system compatible BOM - How to use this is explained in eeschema.pdf chapter 14. You enter a command line into the - netlist exporter using a new (custom) tab in the netlist export dialog. - The command line is - xsltproc -o "%O.csv" "FullPathToFile/bom2groupedCsv.xsl" "%I" + How to use this is explained in eeschema.pdf chapter 14. --> @@ -106,4 +101,4 @@ - \ No newline at end of file + diff --git a/eeschema/plugins/xsl_scripts/bom_with_title_block_2_csv.xsl b/eeschema/plugins/xsl_scripts/bom_with_title_block_2_csv.xsl index 3acd05e3e4..16e5dec729 100644 --- a/eeschema/plugins/xsl_scripts/bom_with_title_block_2_csv.xsl +++ b/eeschema/plugins/xsl_scripts/bom_with_title_block_2_csv.xsl @@ -24,12 +24,15 @@ -->