Skip to content

Commit

Permalink
Fixed bugs related to KiCad only part creation
Browse files Browse the repository at this point in the history
  • Loading branch information
eeintech committed Aug 12, 2021
1 parent cfa54ba commit e605186
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions kintree/kintree_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,8 @@ def build_choices(items: dict, category: str, subcategory=None) -> list:
for cat in items.keys():
if cat != category and cat != 'uncategorized':
for key in items[cat].keys():
more_choices.append(key)
if key not in choices and key not in more_choices:
more_choices.append(key)

# Process uncategorized entries
try:
Expand Down Expand Up @@ -1032,13 +1033,13 @@ def main():
else:
if not categories[0]:
pseudo_categories = [symbol, None]
part_data = inventree_interface.translate_supplier_to_inventree(supplier=values['supplier'],
part_info=part_info,
categories=pseudo_categories)
part_data = inventree_interface.translate_form_to_inventree(part_info=part_info,
categories=pseudo_categories,
is_custom=CREATE_CUSTOM)
else:
part_data = inventree_interface.translate_supplier_to_inventree(supplier=values['supplier'],
part_info=part_info,
categories=categories)
part_data = inventree_interface.translate_form_to_inventree(part_info=part_info,
categories=categories,
is_custom=CREATE_CUSTOM)
part_data['parameters']['Symbol'] = symbol
part_data['parameters']['Footprint'] = footprint
if not part_data:
Expand All @@ -1055,6 +1056,10 @@ def main():
part_data['IPN'] = part_data['name']
else:
part_data['IPN'] = values['part_number']

# Replace spaces with hyphens
part_data['IPN'] = part_data['IPN'].replace(' ', '-')

if part_data['datasheet']:
part_data['inventree_url'] = part_data['datasheet']

Expand Down

0 comments on commit e605186

Please sign in to comment.