def filename(self): filename = self.name if self.set != '': filename = self.set + '-' + filename if self.face != 0: filename = filename + '-' + str(self.face) extension = self.image.split('.')[-1] return images.cache_location(filename + '.' + extension)
def test_make_deck(self): #this is the BIG KAHUNA datasource = ScryfallCardFactory(images.cache_location('default.jpg')) reader = DeckstatsDecklistReader('Ashling', datasource, upload=False) reader.processCard('1 Ashling, the Pilgrim #!Commander') reader.processCard('99 Mountain') deck_json = reader.deck.to_json() with out as open('Ashling.json', 'w'): out.write(deck_json)
def setUpClass(cls): cls.ds = ScryfallCardFactory(images.cache_location('default.jpg'))
def setUpClass(cls): cls.image = images.open_image(images.cache_location('aaron.jpg'))
import argparse import sys from decklist.deckstats import DeckstatsDecklistReader from decklist.mtgo import MTGODecklistReader from decklist.arena import ArenaDecklistReader import scryfall import imgur from images import cache_location DEFAULT_IMAGE = cache_location('default.jpg') def main(): parser = argparse.ArgumentParser( description='Tabletop Simulator Deck Generator') parser.add_argument( '-f', '--format', choices=( 'MTGO', 'mtgo', 'Arena', 'arena', 'Deckstats', 'deckstats'), default='deckstats', help='Format for the decklist file') parser.add_argument( '-n', '--no_upload', default=False, const=True, action='store_const', help='if specified, do not upload the file to imgur') parser.add_argument( 'decklist_file', help='Name of the text file containing the decklist', nargs='?') parser.add_argument( 'deck_name',