hildogjr / KiCost

Build cost spreadsheet for a KiCad project.
MIT License
524 stars 97 forks source link

Field "Manufacturer" in the input is renamed to "manf" in input, but not in spreadsheet #336

Closed timoalho closed 6 years ago

timoalho commented 6 years ago

Specifically: if I have a field called "Manufacturer", it gets renamed to "manf" by the mapping in 'tools.py:97'. However, if I use the option '--fields Manufacturer', both a field called 'manf' and 'Manufacturer' appear in the output spreadsheet, with the 'Manufacturer' column being empty.

The renaming should be done consistently everywhere, or alternatively should be disabled for fields passed as arguments to '--field', under the assumption that the user really wants to keep the name they're using.

hildogjr commented 6 years ago

Linked with #333

hildogjr commented 6 years ago

The renaming will need a code refacture of parts of KiCost. I will add an assert not not allow the user to rename this. This kind of column rename should be done at the output spreadsheet.

hildogjr commented 6 years ago

If you want to use "Manufacturer" as an user field, remove from the internal dictionary using --translate_field Manufacturer, command just created to solve #333, so it can be used as personal field now.

kicost ... --translate_field Manufacturer --field Manufacture

will read the Manufacture BOM field information without the translate logic and present as an user filed (careful because this can affect the grouping logic if used with manf#, ...).