Skip to content

Commit

Permalink
Added distributor description as catalog comment
Browse files Browse the repository at this point in the history
  • Loading branch information
set-soft committed Oct 26, 2021
1 parent 8401c3d commit abced19
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions kicost/__init__.py
Expand Up @@ -17,6 +17,7 @@ def __init__(self):
# self.info_dist = None # Currently unused.
self.currency = None # Default currency.
self.moq = None # Minimum order quantity allowd by the distributor.
self.description = None


# Class for storing part group information.
Expand Down
1 change: 1 addition & 0 deletions kicost/distributors/api_digikey.py
Expand Up @@ -123,6 +123,7 @@ def _query_part_info(parts, distributors, currency):
dd.part_num = data.digi_key_part_number
dd.qty_avail = data.quantity_available
dd.currency = data.search_locale_used.currency
dd.description = data.product_description
dd.price_tiers = {p.break_quantity: p.unit_price for p in data.standard_pricing}
part.dd[DIST_NAME] = dd
distributor_class.logger.log(DEBUG_OBSESSIVE, '* Part info after adding data:')
Expand Down
7 changes: 5 additions & 2 deletions kicost/spreadsheet.py
Expand Up @@ -285,7 +285,7 @@ def __init__(self, workbook, worksheet_name, prj_info, currency=DEFAULT_CURRENCY
# Currency format and symbol definition
self.set_currency(currency)
# Extra information characteristics of the components gotten in the page that will be displayed as comment in the 'cat#' column.
self.extra_info_display = ['value', 'tolerance', 'footprint', 'power', 'current', 'voltage', 'frequency', 'temp_coeff', 'manf', 'size']
self.extra_info_display = ['Description', 'value', 'tolerance', 'footprint', 'power', 'current', 'voltage', 'frequency', 'temp_coeff', 'manf', 'size']
# Create the worksheet that holds the pricing information.
self.wks = workbook.add_worksheet(worksheet_name)
# Data to performe cell size adjust
Expand Down Expand Up @@ -976,7 +976,10 @@ def add_dist_to_worksheet(ss, logger, columns_global, start_row, start_col, unit
if dist_part_num is None:
row += 1 # Skip this row and go to the next.
continue
dist_info_dist = {} # Not implemented
dist_info_dist = {}
if dd.description:
print(dd.description)
dist_info_dist['Description'] = dd.description
dist_currency = dd.currency # Extract currency used by the distributor.

# Enter distributor part number for ordering purposes.
Expand Down

0 comments on commit abced19

Please sign in to comment.