indeed a cleanup could be needed
the way we specified it in the other scripts is like this
all_params = {
“0271” : make_params( 2, ‘Molex_53261_0271’),
“0371” : make_params( 3, ‘Molex_53261_0371’),
“0471” : make_params( 4, ‘Molex_53261_0471’),
“0571” : make_params( 5, ‘Molex_53261_0571’),
“0671” : make_params( 6, ‘Molex_53261_0671’),
“0771” : make_params( 7, ‘Molex_53261_0771’),
“0871” : make_params( 8, ‘Molex_53261_0871’),
“0971” : make_params( 9, ‘Molex_53261_0971’),
“1071” : make_params(10, ‘Molex_53261_1071’),
“1171” : make_params(11, ‘Molex_53261_1171’),
“1271” : make_params(12, ‘Molex_53261_1271’),
“1371” : make_params(13, ‘Molex_53261_1371’),
“1471” : make_params(14, ‘Molex_53261_1471’),
“1571” : make_params(15, ‘Molex_53261_1571’),
“1771” : make_params(17, ‘Molex_53261_1771’)
}
kicad_naming_params = {
“0271” : make_params( 2, extraoffset, ‘Molex_PicoBlade_53261-0271_02x1.25mm_Angled’),
“0371” : make_params( 3, extraoffset, ‘Molex_PicoBlade_53261-0371_03x1.25mm_Angled’),
“0471” : make_params( 4, extraoffset, ‘Molex_PicoBlade_53261-0471_04x1.25mm_Angled’),
“0571” : make_params( 5, extraoffset, ‘Molex_PicoBlade_53261-0571_05x1.25mm_Angled’),
“0671” : make_params( 6, extraoffset, ‘Molex_PicoBlade_53261-0671_06x1.25mm_Angled’),
“0771” : make_params( 7, extraoffset, ‘Molex_PicoBlade_53261-0771_07x1.25mm_Angled’),
“0871” : make_params( 8, extraoffset, ‘Molex_PicoBlade_53261-0871_08x1.25mm_Angled’),
“0971” : make_params( 9, extraoffset, ‘Molex_PicoBlade_53261-0971_09x1.25mm_Angled’),
“1071” : make_params(10, extraoffset, ‘Molex_PicoBlade_53261-1071_10x1.25mm_Angled’),
“1171” : make_params(11, extraoffset, ‘Molex_PicoBlade_53261-1171_11x1.25mm_Angled’),
“1271” : make_params(12, extraoffset, ‘Molex_PicoBlade_53261-1271_12x1.25mm_Angled’),
“1371” : make_params(13, extraoffset, ‘Molex_PicoBlade_53261-1371_13x1.25mm_Angled’),
“1471” : make_params(14, extraoffset, ‘Molex_PicoBlade_53261-1471_14x1.25mm_Angled’),
“1571” : make_params(15, extraoffset, ‘Molex_PicoBlade_53261-1571_15x1.25mm_Angled’),
“1771” : make_params(17, extraoffset, ‘Molex_PicoBlade_53261-1771_17x1.25mm_Angled’)
}
this way it can be changed quite easy at
def generate_part(part_key):
pins = generate_pins(all_params[part_key])
body = generate_body(all_params[part_key])
#pins = generate_pins(kicad_naming_params[part_key])
#body = generate_body(kicad_naming_params[part_key])
return (pins, body)
this way there is always the parameters used for generating the files for kicad and users can use the other ones for adding non kicad compliant parameters