SchrodingersGat / KiBoM

Configurable BoM generation tool for KiCad EDA (http://kicad.org/)
MIT License
352 stars 95 forks source link

Add support for arbitrary filenames #60

Closed trentks closed 4 years ago

trentks commented 4 years ago

Hi @SchrodingersGat,

I wasn't quite happy with the implementation of the filename and the inclusion of variants (#58). This implementation is far more flexible (and extensible for further options in future). See what you think. I've kept the defaults such that they produce the same file names as the existing implementation.

Cheers.


Patch allows for user-specification of arbitrary filename. Will work on both the command line and from within KiCAD. Should be extensible to allow for other fields/options to be added in future. Currently only supports version (%v), variant name/s (%V), and base file name (%O).

Some examples follows which explains motivation further.


With: output_file_name = %O_v%v%V variant_file_name_format=_(option:%V)

running: python "KiBoM/KiBOM_CLI.py" "%I" "%O" -r OPTNAME

would produce: SCHEMATICNAMEv1.0(option:OPTNAME).csv

running: python "KiBoM/KiBOM_CLI.py" "%I" "%O.html"

would produce: SCHEMATICNAME_v1.0.html

trentks commented 4 years ago

Hi @SchrodingersGat,

I was going to make a separate pull request for the changes in f56853cae280fe8c5eda443dadecb85c4709d8ab but I'll include them here.

That commit also adds support for multiple BoMs being generated at the same time, and support for a BoM subdirectory. I think this is the last of the tweeks that I need to make to improve my workflow, so this should be ready for merging with master.

Cheers.

trentks commented 4 years ago

Sorry, now it should be good!

trentks commented 4 years ago

Changed documentation to resolve #53, #55 expected behavior issue---though I suspect the actual fault was inadvertently fixed with #37.

SchrodingersGat commented 4 years ago

@trentks thanks again for your work on this. I agree that this provides a superset of existing features so I am happy to merge.