Skip to content

Commit

Permalink
Merge 23eab93 into d1a59de
Browse files Browse the repository at this point in the history
  • Loading branch information
eeintech committed Apr 2, 2024
2 parents d1a59de + 23eab93 commit 17abfd4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test_deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
export len_log=$(cat gui.log | wc -l)
[[ ${len_log} -eq 0 ]] && true || false
- name: Setup Digi-Key token
if: github.event.pull_request.head.repo.full_name == 'sparkmicro/Ki-nTree'
if: ${{ github.ref == 'refs/heads/main' || github.event.pull_request.head.repo.full_name == 'sparkmicro/Ki-nTree' }}
run: |
git clone https://$TOKEN_DIGIKEY@github.com/eeintech/digikey-token.git
cd digikey-token/
Expand All @@ -108,7 +108,7 @@ jobs:
echo -e "Digi-Key Token: $dk_token\n"
cd ..
- name: Run tests
if: github.event.pull_request.head.repo.full_name == 'sparkmicro/Ki-nTree'
if: ${{ github.ref == 'refs/heads/main' || github.event.pull_request.head.repo.full_name == 'sparkmicro/Ki-nTree' }}
run: |
invoke test -e 1
env:
Expand All @@ -119,7 +119,7 @@ jobs:
run: |
invoke test -e 0
- name: Coveralls
if: github.event.pull_request.head.repo.full_name == 'sparkmicro/Ki-nTree'
if: ${{ github.ref == 'refs/heads/main' || github.event.pull_request.head.repo.full_name == 'sparkmicro/Ki-nTree' }}
run: |
coveralls --version
coveralls --service=github
Expand Down
6 changes: 4 additions & 2 deletions kintree/database/inventree_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,8 @@ def translate_form_to_inventree(part_info: dict, category_tree: list, is_custom=
inventree_part['pricing'] = part_info.get('pricing', {})
inventree_part['currency'] = part_info.get('currency', 'USD')

parameters = part_info.get('parameters', {})

# Load parameters map
if category_tree:
parameter_map = config_interface.load_category_parameters(
Expand All @@ -335,7 +337,7 @@ def translate_form_to_inventree(part_info: dict, category_tree: list, is_custom=
parameter_value = part_tools.clean_parameter_value(
category=category_tree[0],
name=supplier_param,
value=part_info['parameters'][supplier_param],
value=parameters[supplier_param],
)
inventree_part['parameters'][inventree_param] = parameter_value
except KeyError:
Expand All @@ -354,7 +356,7 @@ def translate_form_to_inventree(part_info: dict, category_tree: list, is_custom=

# Check for extra parameters which weren't mapped
parameters_unmapped = []
for search_param in part_info['parameters'].keys():
for search_param in parameters.keys():
if search_param not in parameter_map.keys():
parameters_unmapped.append(search_param)

Expand Down
1 change: 1 addition & 0 deletions kintree/gui/views/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ def run_search(self, e):
message=error_msg,
)
else:
self.fields['part_number'].value = self.fields['part_number'].value.strip()
self.page.splash.visible = True
self.page.update()

Expand Down
2 changes: 1 addition & 1 deletion kintree/search/snapeda_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def test_snapeda_api() -> bool:
result = False

# Test single result
response = fetch_snapeda_part_info('SN74LV4T125PWR')
response = fetch_snapeda_part_info('NTR06B2001CTRF')
data = parse_snapeda_response(response)
images = download_snapeda_images(data)

Expand Down

0 comments on commit 17abfd4

Please sign in to comment.