Add possibility to cherry pick card tabs using a file.
This commit is contained in:
parent
782edb061d
commit
bce83554f4
@ -790,6 +790,8 @@ class DominionTabs:
|
|||||||
help="include a few dividers with extra text")
|
help="include a few dividers with extra text")
|
||||||
parser.add_option("--exclude_events", action="store_true",
|
parser.add_option("--exclude_events", action="store_true",
|
||||||
default=False, help="exclude individual dividers for events")
|
default=False, help="exclude individual dividers for events")
|
||||||
|
parser.add_option("--cardlist", type="string", dest="cardlist", default=None,
|
||||||
|
help="Path to file that enumerates each card to be printed on its own line.")
|
||||||
|
|
||||||
options, args = parser.parse_args(argstring)
|
options, args = parser.parse_args(argstring)
|
||||||
if not options.cost:
|
if not options.cost:
|
||||||
@ -851,6 +853,15 @@ class DominionTabs:
|
|||||||
self.paperwidth, self.paperheight = self.parseDimensions(papersize)
|
self.paperwidth, self.paperheight = self.parseDimensions(papersize)
|
||||||
print 'Using custom paper size, %.2fcm x %.2fcm' % (self.paperwidth / cm, self.paperheight / cm)
|
print 'Using custom paper size, %.2fcm x %.2fcm' % (self.paperwidth / cm, self.paperheight / cm)
|
||||||
|
|
||||||
|
self.cardlist = None
|
||||||
|
if self.options.cardlist:
|
||||||
|
print self.options.cardlist
|
||||||
|
self.cardlist = set()
|
||||||
|
with open(self.options.cardlist) as cardfile:
|
||||||
|
for line in cardfile:
|
||||||
|
self.cardlist.add(line.strip())
|
||||||
|
|
||||||
|
|
||||||
if self.options.orientation == "vertical":
|
if self.options.orientation == "vertical":
|
||||||
self.tabWidth, self.tabBaseHeight = dominionCardHeight, dominionCardWidth
|
self.tabWidth, self.tabBaseHeight = dominionCardHeight, dominionCardWidth
|
||||||
else:
|
else:
|
||||||
@ -1006,6 +1017,9 @@ class DominionTabs:
|
|||||||
if self.options.exclude_events:
|
if self.options.exclude_events:
|
||||||
cards = [card for card in cards if not card.isEvent() or card.name == 'Events']
|
cards = [card for card in cards if not card.isEvent() or card.name == 'Events']
|
||||||
|
|
||||||
|
if self.cardlist:
|
||||||
|
cards = [card for card in cards if card.name in self.cardlist]
|
||||||
|
|
||||||
if options.expansion_dividers:
|
if options.expansion_dividers:
|
||||||
cardnamesByExpansion = {}
|
cardnamesByExpansion = {}
|
||||||
for c in cards:
|
for c in cards:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user