Fix for base cards printing with expansions (#182)

* Fix for base cards printing with expansions

* Allow base set and base cards in expansions

This changes the existing behavior to allow both the printing of the base set as well as printing base cards with expansions that have them via the --base_cards_with_expansion option.  Prior behavior would eliminate the base set if printing with the --base_cards_with_expansion option.
This commit is contained in:
Wendel Voigt 2017-12-11 12:47:49 -06:00 committed by Peter
parent 56adb5ff12
commit 559a8723c0

View File

@ -960,10 +960,10 @@ def filter_sort_cards(cards, options):
# Set up the card sorter
cardSorter = CardSorter(
options.order,
{card.card_tag: card.name for card in cards if card.cardset_tag.lower() == 'base'})
if options.base_cards_with_expansion:
cards = [card for card in cards if card.cardset_tag.lower() != 'base']
else:
{card.card_tag: card.name for card in cards if 'base' in [set_name.lower() for set_name in card.cardset_tags]})
# Optionally remove base cards from expansions that have them
if not options.base_cards_with_expansion:
cards = [card for card in cards
if not cardSorter.isBaseExpansionCard(card)]