Skip to content

Commit

Permalink
Correct style errors found by flake
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeoLacruz committed Dec 9, 2024
1 parent c2554b5 commit d6f2b44
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
runs-on: ubuntu-latest
environment:
name: release
url: https://pypi.org/p/inventree-supplier-panel
url: https://pypi.org/p/inventree-supplier-sync
permissions:
id-token: write

Expand Down
9 changes: 3 additions & 6 deletions inventree_supplier_sync/mouser.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,7 @@
], 'SearchResults': None}
"""
from common.models import InvenTreeSetting

from .request_wrappers import Wrappers
from .meta_access import MetaAccess

import re
import json
Expand Down Expand Up @@ -78,14 +75,14 @@ def get_mouser_partdata(self, sku, options):
# If we are here, Mouser responded. Lets look for errors. Some
# errors do not come in the Errors array, but in a Message.
# Lets check those first
try:
part_data['error_status'] = response['Message']
try:
part_data['error_status'] = response['Message']
return part_data
except Exception:
pass

# Then we evaluate the Errors array. there are some known errors
# and the rest.
# and the rest.
if response['Errors'] != []:
if response['Errors'][0]['Code'] == 'InvalidCharacters':
part_data['error_status'] = 'InvalidCharacters'
Expand Down
11 changes: 2 additions & 9 deletions inventree_supplier_sync/request_wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def post_request(self, post_data, path, headers):
timeout=5,
headers=headers)
except Exception as e:
return e.args
return (e.args)
return (response)

def get_request(self, path, headers):
Expand All @@ -40,12 +40,5 @@ def get_request(self, path, headers):
timeout=5,
headers=headers)
except Exception as e:
self.status_code = e.args
raise ConnectionError
if response.status_code != 200:
self.status_code = response.status_code
self.message = response.content
return (response)
self.status_code = response.status_code
self.message = 'OK'
return (e.args)
return (response)
2 changes: 1 addition & 1 deletion inventree_supplier_sync/supplier_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class SupplierSyncPlugin(AppMixin, ScheduleMixin, SettingsMixin, PanelMixin, Inv
'member': {
'func': 'update_part',
'schedule': 'I',
'minutes': 3,
'minutes': 1,
}
}

Expand Down

0 comments on commit d6f2b44

Please sign in to comment.