Skip to content

Commit

Permalink
Added more debug messages to format_data.py
Browse files Browse the repository at this point in the history
Signed-off-by: George Araújo <george.gcac@gmail.com>
  • Loading branch information
george-gca committed Dec 23, 2024
1 parent 1bcedf9 commit 7aa4e41
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions format_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ def main(file: Path):
# sort cards by 'title' value
try:
data = sorted(data, key=lambda x: strip_accents(x['title'].lower()))
except AttributeError:
cards_without_title = [card['description'] for card in data if card['title'] is None]
print(f'Warning: the following cards do not have a title: {cards_without_title}')
raise
except KeyError:
cards_without_title = [card['description'] for card in data if 'title' not in card]
print(f'Warning: the following cards do not have a title: {cards_without_title}')
Expand Down

0 comments on commit 7aa4e41

Please sign in to comment.