diff --git a/kibot/kiplot.py b/kibot/kiplot.py index a88e2cb0..833190e4 100644 --- a/kibot/kiplot.py +++ b/kibot/kiplot.py @@ -853,16 +853,15 @@ def generate_one_example(dest_dir, types): yaml_dump(f, {'global': glb}) f.write('\n') # A helper for the internal templates - imports = [{'file': man} for man in ['Elecrow', 'FusionPCB', 'JLCPCB', 'PCBWay']] - yaml_dump(f, {'import': imports}) - f.write('\n') - # A helper for KiCost demo - var = {'name': 'place_holder'} - var['comment'] = 'Just a place holder for pre_transform filters' - var['type'] = 'kicost' - var['pre_transform'] = ['_kicost_rename', '_rot_footprint'] - yaml_dump(f, {'variants': [var]}) - f.write('\n') + needed_imports = [] + if GS.pcb_file: + needed_imports.extend(['Elecrow', 'FusionPCB', 'JLCPCB', 'PCBWay']) + if GS.sch_file and GS.pcb_file: + needed_imports.append('MacroFab_XYRS') + if needed_imports: + imports = [{'file': man} for man in needed_imports] + yaml_dump(f, {'import': imports}) + f.write('\n') # All the outputs outputs = [] for n, cls in OrderedDict(sorted(outs.items())).items(): diff --git a/kibot/out_bom.py b/kibot/out_bom.py index 71b04e45..50d30722 100644 --- a/kibot/out_bom.py +++ b/kibot/out_bom.py @@ -995,8 +995,6 @@ class BoM(BaseOutput): # noqa: F821 for tpl in templates: for out in tpl: if out['type'] == 'bom': - # Use the KiCost + rotate variant - out['options']['variant'] = 'place_holder' columns = out['options'].get('columns', None) if columns: # Rename MPN for something we have, or just remove it @@ -1085,7 +1083,9 @@ class BoM(BaseOutput): # noqa: F821 grp.append(d+'#') gb = BoM.create_bom('XLSX', 'Costs', grp, join_fields, fld_names) gb['options']['xlsx'] = {'style': 'modern-green', 'kicost': True, 'specs': True} - gb['options']['variant'] = 'place_holder' + # KitSpace seems to be failing all the time + gb['options']['xlsx']['kicost_api_disable'] = 'KitSpace' + gb['options']['pre_transform'] = '_kicost_rename' # gb['options']['distributors'] = list(dists) outs.append(gb) # Add the list of layers to the templates