Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update add_extra_index_info.py #174

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions scripts/add_extra_index_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,13 @@ def add(indexed_item_source, gh_token, es_index):
else:
download_database('https://github.com/MikroElektronika/core_packages/blob/main/necto_db.db?raw=true', db_path)

# Get extra info for boards
if indexed_item_source['category'] == 'Board Package':
doc_extra_info = form_extra_information('board', indexed_item_source['display_name'], indexed_item_source['download_link'], gh_token)
# Get extra info for cards
elif indexed_item_source['category'] == 'Card Package':
doc_extra_info = form_extra_information('card', indexed_item_source['display_name'], indexed_item_source['download_link'], gh_token)
if doc_extra_info != {}:
indexed_item_source.update(doc_extra_info)
print(f"INFO: Added \"extra_information\" to {indexed_item_source['name']}")
if 'category' in indexed_item_source:
# Get extra info for boards
if indexed_item_source['category'] == 'Board Package':
doc_extra_info = form_extra_information('board', indexed_item_source['display_name'], indexed_item_source['download_link'], gh_token)
# Get extra info for cards
elif indexed_item_source['category'] == 'Card Package':
doc_extra_info = form_extra_information('card', indexed_item_source['display_name'], indexed_item_source['download_link'], gh_token)
if doc_extra_info != {}:
indexed_item_source.update(doc_extra_info)
print(f"INFO: Added \"extra_information\" to {indexed_item_source['name']}")
Loading