diff --git a/.travis.yml b/.travis.yml index 94ff9120..838a47c5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ cache: pip # enable cache for "$HOME/.cache/pip" directory before_install: - export CFLAGS=-O0 # considerably speed-up build time for pip packages (especially lxml), optimizations doesn't matter for ci - - pip install commentjson + - pip install PyYAML - python verify_files.py # make sure input files are OK before wasting time with prereqs install: diff --git a/cards_corrections b/cards_corrections deleted file mode 100644 index 0816bf8d..00000000 --- a/cards_corrections +++ /dev/null @@ -1,101 +0,0 @@ -// Objects to be fixed -// -// { -// "Card Name 1": { -// "Key 1": "New Value", -// "Key 2": "New Value" -// }, -// "Card Name 2": { -// "Key 1": "New Value" -// } -// } -// -// List of Keys: -// -// Hints: -// If you fix a card "type", it's important to fix card "types" (only found in json file) as well! - -{ - "Angel of the God-Pharoh": { - "name": "Angel of the God-Pharaoh" - }, - "Blood Moon": { - "number": "46" - }, - "Damnation": { - "colorIdentity": ["B"] - }, - "Doomsday": { - "number": "42" - }, - "Shatterstorm": { - "number": "48" - }, - "Crook of Comdemnation": { - "name": "Crook of Condemnation" - }, - "Nissa, Genesis Mage": { - "loyalty": "5" - }, - "Hollow One": { - "power": "4", - "toughness": "4" - }, - "Maurauding Boneslasher": { - "name": "Marauding Boneslasher" - }, - "Graven Abomination":{ - "power":"3", - "toughness":"1" - }, - "Wall of Forgotten Pharaohs":{ - "power":"0", - "toughness":"4" - }, - "The Scarab God": { - "url": "http://media.wizards.com/2017/hou/en_oCj378nHkJ.png" - }, - "The Scorpion God": { - "url": "http://media.wizards.com/2017/hou/en_q742Vz27AN.png", - "text": "Whenever a creature with a -1/-1 counter on it dies, draw a card.\n\n{1}{B}{R}: Put a -1/-1 counter on another target creature.\n\nWhen The Scorpion God dies, return it to its owner's hand at the beginning of the next end step." - }, - "Banewhip Punisher": { - "text": "When Banewhip Punisher enters the battlefield, you may put a -1/-1 counter on target creature.\n{B}, Sacrifice Banewhip Punisher: Destroy target creature that has a -1/-1 counter on it." - }, - "Ifnir Deadlands": { - "text": "{T}: Add {C} to your mana pool.\n{T}, Pay 1 life: Add {B} to your mana pool.\n{2}{B}{B}, {T}, Sacrifice a Desert: Put two -1/-1 counters on target creature an opponent controls. Activate this ability only any time you could cast a sorcery." - }, - "Ipnu Rivulet": { - "text": "{T}: Add {C} to your mana pool.\n{T}, Pay 1 life: Add {U} to your mana pool.\n{1}{U}, {T}, Sacrifice a Desert: Target player puts the top four cards of his or her library into his or her graveyard." - }, - "Ramunap Ruins": { - "text": "{T}: Add {C} to your mana pool.\n{T}, Pay 1 life: Add {R} to your mana pool.\n{2}{R}{R}, {T}, Sacrifice a Desert: Ramunap Ruins deals 2 damage to each opponent." - }, - "Scavenger Grounds": { - "text": "{T}: Add {C} to your mana pool.\n{2}, {T}, Sacrifice a Desert: Exile all cards from all graveyards." - }, - "Shefet Dunes": { - "text": "{T}: Add {C} to your mana pool.\n{T}, Pay 1 life: Add {W} to your mana pool.\n{2}{W}{W}, {T}, Sacrifice a Desert: Creatures you control get +1/+1 until end of turn. Activate this ability only any time you could cast a sorcery." - }, - "Unconventional Tactics": { - "text": "Target creature gets +3/+3 and gains flying until end of turn.\nWhenever a Zombie enters the battlefield under your control, you may pay {W}. If you do, return Unconventional Tactics from your graveyard to your hand." - }, - "Unraveling Mummy": { - "text": "{1}{W}: Target attacking Zombie gains lifelink until end of turn.\n\n{1}{B}: Target attacking Zombie gains deathtouch until end of turn." - }, - "Feral Prowler": { - "type": "Creature - Cat", - "types":[ - "Creature" - ] - }, - "Visage of Bolas": { - "text": "When Visage of Bolas enters the battlefield, you may search your library and/or graveyard for a card named Nicol Bolas, the Deceiver, reveal it, and put it into your hand. If you search your library this way, shuffle it.\n{T}: Add {U}, {B}, or {R} to your mana pool." - }, - "Cinder Barrens": { - "text": "Cinder Barrens enters the battlefield tapped.\n{T}: Add {B} or {R} to your mana pool." - }, - "Sifter Wurm": { - "rarity": "Uncommon" - } -} diff --git a/cards_corrections.yml b/cards_corrections.yml new file mode 100644 index 00000000..224b08a8 --- /dev/null +++ b/cards_corrections.yml @@ -0,0 +1,91 @@ +# Objects to be fixed +# +# Format is +# +# Card Name: +# field to fix: new value +# +# Ex: +# +# Jace, the Planeswalker: +# loyalty: 5 +# manaCost: 1UUB +# +# Fields and their values +# name: Card Name +# cmc: 4 +# colorIdentity: +# - U +# - B +# colors: +# - Blue +# - Black +# manaCost: 1UUB +# number: 140 +# rarity: Mythic Rare +# power: X +# text: "{5}, {T}: You win the game." +# toughness: * +# type: Legendary Artifact Creature - Human Monk +# url: http://wizards.c0m/link/to/card.png +# +# Indentation is critical, two spaces per indentation + + +Angel of the God-Pharoh: + name: Angel of the God-Pharaoh +Blood Moon: + number: 46 +Damnation: + colorIdentity: + - B +Doomsday: + number: 42 +Shatterstorm: + number: 48 +Crook of Comdemnation: + name: Crook of Condemnation +Nissa, Genesis Mage: + loyalty: 5 +Hollow One: + power: 4 + toughness: 4 +Maurauding Boneslasher: + name: Marauding Boneslasher +Graven Abomination: + power: 3 + toughness: 1 +Wall of Forgotten Pharaohs: + power: 0 + toughness: 4 +The Scarab God: + url: http://media.wizards.com/2017/hou/en_oCj378nHkJ.png +The Scorpion God: + url: http://media.wizards.com/2017/hou/en_q742Vz27AN.png + text: "Whenever a creature with a -1/-1 counter on it dies, draw a card.\n\n{1}{B}{R}: Put a -1/-1 counter on another target creature.\n\nWhen The Scorpion God dies, return it to its owner's hand at the beginning of the next end step." +Banewhip Punisher: + text: "When Banewhip Punisher enters the battlefield, you may put a -1/-1 counter on target creature.\n{B}, Sacrifice Banewhip Punisher: Destroy target creature that has a -1/-1 counter on it." +Ifnir Deadlands: + text: "{T}: Add {C} to your mana pool.\n{T}, Pay 1 life: Add {B} to your mana pool.\n{2}{B}{B}, {T}, Sacrifice a Desert: Put two -1/-1 counters on target creature an opponent controls. Activate this ability only any time you could cast a sorcery." +Ipnu Rivulet: + text: "{T}: Add {C} to your mana pool.\n{T}, Pay 1 life: Add {U} to your mana pool.\n{1}{U}, {T}, Sacrifice a Desert: Target player puts the top four cards of his or her library into his or her graveyard." +Ramunap Ruins: + text: "{T}: Add {C} to your mana pool.\n{T}, Pay 1 life: Add {R} to your mana pool.\n{2}{R}{R}, {T}, Sacrifice a Desert: Ramunap Ruins deals 2 damage to each opponent." +Scavenger Grounds: + text: "{T}: Add {C} to your mana pool.\n{2}, {T}, Sacrifice a Desert: Exile all cards from all graveyards." +Shefet Dunes: + text: "{T}: Add {C} to your mana pool.\n{T}, Pay 1 life: Add {W} to your mana pool.\n{2}{W}{W}, {T}, Sacrifice a Desert: Creatures you control get +1/+1 until end of turn. Activate this ability only any time you could cast a sorcery." +Unconventional Tactics: + text: Target creature gets +3/+3 and gains flying until end of turn.\nWhenever a Zombie enters the battlefield under your control, you may pay {W}. If you do, return Unconventional Tactics from your graveyard to your hand. +Unraveling Mummy: + text: "{1}{W}: Target attacking Zombie gains lifelink until end of turn.\n\n{1}{B}: Target attacking Zombie gains deathtouch until end of turn." +Feral Prowler: + type: Creature - Cat + types: + - Creature +Visage of Bolas: + text: "When Visage of Bolas enters the battlefield, you may search your library and/or graveyard for a card named Nicol Bolas, the Deceiver, reveal it, and put it into your hand. If you search your library this way, shuffle it.\n{T}: Add {U}, {B}, or {R} to your mana pool." +Cinder Barrens: + text: "Cinder Barrens enters the battlefield tapped.\n{T}: Add {B} or {R} to your mana pool." +Sifter Wurm: + rarity: Uncommon diff --git a/cards_delete b/cards_delete deleted file mode 100644 index 8428c320..00000000 --- a/cards_delete +++ /dev/null @@ -1,16 +0,0 @@ -// List of card strings to be removed -// [ -// "Card Name 1", -// "Card Name 2" -// ] -// Case-sensitive -// Exact card name matches only (e.g. trailing spaces) -// Will just remove cards from normal spoiler sets, not masterpieces/mps files - -[ - "Sunset Pyramid (TO DELETE)", - "Thoughtseize", - "Endless ", - "Crumbling Necropolis", - "Imaginary Thr" -] diff --git a/cards_delete.yml b/cards_delete.yml new file mode 100644 index 00000000..68292d26 --- /dev/null +++ b/cards_delete.yml @@ -0,0 +1,14 @@ +# each card to delete should be a new line, two spaces, a -, a space, card name +# cards that begin/end with a space or contain a colon need quoted +# +# ex +# delete: +# - Not a Real Card +# - " Test Card " + +delete: + - Sunset Pyramid (TO DELETE) + - Thoughtseize + - "Endless " + - Crumbling Necropolis + - Imaginary Thr \ No newline at end of file diff --git a/cards_manual b/cards_manual deleted file mode 100644 index 7c92a04f..00000000 --- a/cards_manual +++ /dev/null @@ -1,420 +0,0 @@ -{ - "meta": { - "instructions": "If you would like to add a card manually, use the 'blank card' template below.", - "instructions2": "Check example_card_details for more information", - "instructions3": "add the card to the 'cards' array below meta", - "example card (do not include this key, just the object)": { - "cmc": 7, - "colorIdentity": [ - "W", - "B", - "G" - ], - "colors": [ - "White", - "Black" - ], - "layout": "normal", - "manaCost": "{X}{5}{W}{B}", - "name": "Example Card", - "number": "55", - "power": "*", - "rarity": "Mythic Rare", - "subtypes": [ - "Zombie" - ], - "text": "Shadow, Flying, Horsemanship\nExample Card's power is equal to something.\n{G}, {T}: Unfloop target pig you control.", - "toughness": "2", - "type": "Legendary Creature - Zombie", - "types": [ - "Creature" - ] - }, - "example card details": { - "meta": { - "values": "All fields (including loyalty) are string or array of strings except CMC which is int", - "required fields (all cards)": [ - "name", - "number", - "rarity", - "type", - "url" - ] - } - }, - "blank card (do not use this key, just the object) - remove unneeded keys": { - "name": "", - "manaCost": "", - "number": "", - "rarity": "", - "type": "", - "url": "", - "text": "", - "loyalty": "", - "cmc": 0, - "layout": "", - "power": "", - "toughness": "" - } - }, - "HOU": { - "cards": [ - { - "name": "Nicol Bolas, God-Pharaoh", - "manaCost": "4UBR", - "number": "140", - "rarity": "Mythic Rare", - "type": "Planeswalker - Bolas", - "url": "https://i.imgur.com/DTNXG2z.png", - "text": "+2: Target opponent exiles cards from the top of his or her library until he or she exiles a nonland card. Until end of turn, you may cast that card without paying its mana cost.\n+1: Each opponent exiles two cards from his or her hand.\n-4: Nicol Bolas, God-Pharaoh deals 7 damage to target opponent or creature an opponent controls.\n-12: Exile each nonland permanent your opponents control.", - "loyalty": "7", - "cmc": 7 - }, - { - "name": "Bontu's Last Reckoning", - "manaCost": "1BB", - "number": "60", - "rarity": "Rare", - "type": "Sorcery", - "url": "https://i.imgur.com/HOjh3pE.png", - "text": "Destroy all creatures. Lands you control don't untap during your next untap step.", - "cmc": 3 - }, - { - "name": "Samut, the Tested", - "manaCost": "2RG", - "number": "144", - "rarity": "Mythic Rare", - "type": "Planeswalker - Samut", - "url": "https://i.imgur.com/4tRYs5z.png", - "text": "+1: Up to one target creature gains double strike until end of turn.\n-2: Samut, the Tested deals 2 damage divided as you choose among one or two target creatures and/or players.\n-7: Search your library for up to two creature and/or planeswalker cards, put them onto the battlefield, then shuffle your library.", - "loyalty": "4", - "cmc": 4 - }, - { - "name": "Nicol Bolas, the Deceiver", - "manaCost": "5UBR", - "number": "205", - "rarity": "Mythic Rare", - "type": "Planeswalker - Bolas", - "url": "http://mythicspoiler.com/hou/cards/nicolbolasthedeceiver.jpg", - "text": "+3: Each opponent loses 3 life unless that player sacrifices a nonland permanent or discards a card.\n-3: Destroy a creature. Draw a card.\n-11: Nicol Bolas, the Deciever deals 7 damage to each opponent. You draw seven cards. ", - "loyalty": "5", - "cmc": 8 - } - ] - }, - "XLN": { - "cards": [ - { - "name": "Haven Raptor", - "manaCost": "2GG", - "number": "0", - "rarity": "Rare", - "type": "Creature - Dinosaur", - "url": "http://mythicspoiler.com/ixa/cards/havenraptor.jpg", - "text": "Tough - Whenever Haven Raptor is dealt damage, draw a card.", - "cmc": 4, - "power": "4", - "toughness": "5" - }, - { - "name": "Tiehana, Voice of Thunder", - "manaCost": "", - "number": "0", - "rarity": "Rare", - "type": "Legendary Creature - Merfolk", - "url": "http://mythicspoiler.com/ixa/cards/tiehanavoiceofthunder.jpg", - "text": "Tiehana, Voice of Thunder's power and toughness are equal to the number of cards in your hand.\nYou have no maximum hand size.\nWhen Tiehana enters the battlefield, draw a card for each creature you control.", - "cmc": 0, - "power": "*", - "toughness": "*" - }, - { - "name": "Ogre Hand Ravager", - "manaCost": "3BB", - "number": "0", - "rarity": "Rare", - "type": "Creature - Orc Pirate Wizard", - "url": "http://mythicspoiler.com/ixa/cards/ogrehandravager.jpg", - "text": "When Ogre Hand Ravager enters the battlefield, each player loses a third of his or her life, rounded up.", - "cmc": 5, - "power": "4", - "toughness": "4" - }, - { - "name": "Bishop of Rebirth", - "manaCost": "3WW", - "number": "0", - "rarity": "Rare", - "type": "Creature - Vampire Cleric", - "url": "http://mythicspoiler.com/ixa/cards/bishopofrebirth.jpg", - "text": "Whenever Bishop of Rebirth attacks, you may return target creature card with converted mana cost 3 or less from your graveyard to the battlefield.", - "cmc": 5, - "power": "3", - "toughness": "4" - }, - { - "name": "Ashes of the Abhorrent", - "manaCost": "1W", - "number": "0", - "rarity": "Rare", - "type": "Enchantment", - "url": "http://mythicspoiler.com/ixa/cards/ashesoftheabhorrent.jpg", - "text": "Players can't cast spells from graveyards or active abilities of cards in graveyards.\nWhenever a creature dies, you gain 1 life.", - "cmc": 2 - }, - { - "name": "Deeproot Champion", - "manaCost": "1G", - "number": "0", - "rarity": "Rare", - "type": "Creature - Merfolk Champion", - "url": "http://mythicspoiler.com/ixa/cards/deeprootchampion.jpg", - "text": "Whenever you cast a noncreature spell, put a +1/+1 counter on Deeproot Champion.", - "cmc": 2, - "power": "1", - "toughness": "1" - }, - { - "name": "Dreamcaller Siren", - "manaCost": "3UU", - "number": "0", - "rarity": "Rare", - "type": "Creature - Siren Pirate", - "url": "http://mythicspoiler.com/ixa/cards/dreamcallersiren.jpg", - "text": "Flash\nFlying\nDreamcaller Siren can only block creatures with flying.\nWhen Dreamcaller Siren enters the battlefield, if you control another Pirate, tap up to two target nonland permanents.", - "cmc": 5, - "power": "3", - "toughness": "3" - }, - { - "name": "Goring Ceratops", - "manaCost": "5WW", - "number": "0", - "rarity": "Rare", - "type": "Creature - Dinosaur", - "url": "http://mythicspoiler.com/ixa/cards/goringceratops.jpg", - "text": "Double strike\nWhenever Goring Ceratops attacks, other creatures you control gain double strike until end of turn.", - "cmc": 7, - "power": "?", - "toughness": "?" - }, - { - "name": "Hostage Taker", - "manaCost": "2UB", - "number": "0", - "rarity": "Rare", - "type": "Creature - Human Pirate", - "url": "http://mythicspoiler.com/ixa/cards/hostagetaker.jpg", - "text": "When Hostage Taker enters the battlefield, exile target artifact or creature until Hostage Taker leaves the battlefield. You may cast that card for as long as it remains exiled, and you may spend mana as though it were mana of any color to cast that spell.", - "cmc": 4, - "power": "2", - "toughness": "1" - }, - { - "name": "Emperor's Vnguard", - "manaCost": "5G", - "number": "0", - "rarity": "Rare", - "type": "Creature - Unknown", - "url": "http://mythicspoiler.com/ixa/cards/emperorsvanguard.jpg", - "text": "Whenever Emperor's Vanguard ???", - "cmc": 6, - "power": "4", - "toughness": "3" - }, - { - "name": "Drowned Catacomb", - "number": "0", - "rarity": "Rare", - "type": "Land", - "url": "http://mythicspoiler.com/ixa/cards/drownedcatacomb.jpg", - "text": "Drowned Catacomb enters the battlefield tapped unless you control an Island or Swamp.\n{T}: Add {U} or {B} to your mana pool.", - "cmc": 0 - }, - { - "name": "Dragonskull Summit", - "number": "0", - "rarity": "Rare", - "type": "Land", - "url": "http://mythicspoiler.com/ixa/cards/dragonskullsummit.jpg", - "text": "Dragonskull Summit enters the battlefield tapped unless you control a Swamp or Mountain.\n{T}: Add {B} or {R} to your mana pool.", - "cmc": 0 - }, - { - "name": "Ruin Raider", - "manaCost": "2B", - "number": "0", - "rarity": "Rare", - "type": "Creature - Orc Pirate", - "url": "http://mythicspoiler.com/ixa/cards/ruinraider.jpg", - "text": "Raid - At the beginning of your end step, if you attacked with a creature this turn, reveal the top card of your library and put that card into your hand. You lose life equal to that card's converted mana cost.", - "cmc": 3, - "power": "?", - "toughness": "?" - }, - { - "name": "Vraska's Contempt", - "manaCost": "2BB", - "number": "0", - "rarity": "Rare", - "type": "Instant", - "url": "http://mythicspoiler.com/ixa/cards/vraskascontempt.jpg", - "text": "Exile target creature or planeswalker. You gain 2 life.", - "cmc": 4 - }, - { - "name": "Rowdy Crew", - "manaCost": "3RR", - "number": "0", - "rarity": "Mythic Rare", - "type": "Creature - Goblin Pirate", - "url": "http://mythicspoiler.com/ixa/cards/rowdycrew.jpg", - "text": "Trample\nWhen Rowdy Crew enters the battlefield, draw three cards, then discard 2 cards at random. If two cards that share a type are discarded this way, put two +1/+1 counters on Rowdy Crew.", - "cmc": 5, - "power": "3", - "toughness": "3" - }, - { - "name": "Bloodstained Paladin", - "manaCost": "3B", - "number": "0", - "rarity": "Rare", - "type": "Creature - Vampire Knight", - "url": "http://mythicspoiler.com/ixa/cards/bloodstainedpaladin.jpg", - "text": "Flash\nBloodstained Paladin enters the battlefield with a +1/+1 counter on it for each creature that died this turn.", - "cmc": 4, - "power": "3", - "toughness": "4" - }, - { - "name": "Arcane Adaptation", - "manaCost": "2U", - "number": "44", - "rarity": "Mythic Rare", - "type": "Enchantment", - "url": "http://mythicspoiler.com/ixa/cards/arcaneadaptation.jpg", - "text": "As Arcane Adaptation enters the battlefield, choose a creature type.\nCreatures you control are the chosen type in addition to their other types. The same is true for creature spells you control and creature cards you own that aren't on the battlefield.", - "cmc": 3 - }, - { - "name": "Captain Lannery Storm", - "manaCost": "2R", - "number": "0", - "rarity": "Mythic Rare", - "type": "Legendary Creature - Human Pirate", - "url": "http://mythicspoiler.com/ixa/cards/captainlannerystorm.jpg", - "text": "Haste\nWhenever Captain Lannery Storm attacks, create a colorless Treasure artifact token with \"{T}, Sacrifice this artifact: Add one mana of any color to your mana pool.\"\nWhenever you sacrifice a Treasure, Captain Lannery Storm gets +1/+0 until end of turn.", - "cmc": 3, - "power": "2", - "toughness": "2" - }, - { - "name": "Daring Saboteur", - "manaCost": "1U", - "number": "0", - "rarity": "Rare", - "type": "Creature - Human Pirate", - "url": "http://mythicspoiler.com/ixa/cards/daringsaboteur.jpg", - "text": "{2}{U}: Daring Saboteur can't be blocked this turn.\nWhenever Daring Saboteur deals combat damage to a player, you may draw a card. If you do, discard a card.", - "cmc": 2, - "power": "?", - "toughness": "?" - }, - { - "name": "Sorcerous Spyglass", - "manaCost": "2", - "number": "0", - "rarity": "Rare", - "type": "Artifact", - "url": "http://mythicspoiler.com/ixa/cards/sorcerousspyglass.jpg", - "text": "As Sorcerous Spyglass enters the battlefield, look at an opponent's hand, then choose any card name.\nActivated abilities of sources with the chosen name can't be activated unless they're mana abilities.", - "cmc": 2 - }, - { - "name": "Sunpetal Grove", - "number": "0", - "rarity": "Rare", - "type": "Land", - "url": "http://mythicspoiler.com/ixa/cards/sunpetalgrove.jpg", - "text": "Sunpetal Grove enters the battlefield tapped unless you control a Forest or a Plains.\n{T}: Add {G} or {W} to your mana pool.", - "cmc": 0 - }, - { - "name": "Vanquisher's Banner", - "manaCost": "5", - "number": "0", - "rarity": "Rare", - "type": "Artifact", - "url": "http://mythicspoiler.com/ixa/cards/vanquishersbanner.jpg", - "text": "As Vanquisher's Banner enters the battlefield, choose a creature type.\nCreatures you control of the chosen type get +1/+1.\nWhenever you cast a creature spell of the chosen type, draw a card.", - "cmc": 5 - } - ] - }, - "C17": { - "cards": [ - { - "name": "Taigam, Ojutai Master", - "manaCost": "2WU", - "number": "46", - "rarity": "Rare", - "type": "Legendary Creature - Human Monk", - "url": "http://mythicspoiler.com/c17/cards/taigamojutaimaster.jpg", - "text": "Instant, sorcery, and Dragon spells you control can't be countered by spells or abilities.\nWhenever you cast an instant or sorcery spell from your hand, if Taigam, Ojutai Master attacked this turn, that spell gains rebound. (Exile the spell as it resolves. At the beginning of your next upkeep, you may cast that card from exile without paying its mana cost.)", - "cmc": 4, - "power": "3", - "toughness": "4" - }, - { - "name": "Ramos, Dragon Engine", - "manaCost": "6", - "number": "", - "rarity": "Mythic Rare", - "type": "Legendary Artifact Creature - Dragon", - "url": "http://mythicspoiler.com/c17/cards/ramosdragonengine.jpg", - "text": "Flying\nWhenever you cast a spell, put a +1/+1 counter on Ramos, Dragon Engine for each of that spell's colors.\nRemove five +1/+1 counters from Ramos: Add {W}{W}{U}{U}{B}{B}{R}{R}{G}{G} to your mana pool. Activate this ability only once each turn.", - "cmc": 6, - "power": "4", - "toughness": "4" - }, - { - "name": "O-Kagachi, Vengeful Kami", - "manaCost": "1WUBRG", - "number": "0", - "rarity": "Mythic Rare", - "type": "Legendary Creature - Dragon Spirit", - "url": "http://mythicspoiler.com/c17/cards/okagachivengefulkami.jpg", - "text": "Flying, trample\nWhenever O-Kagachi, Vengeful Kami deals combat damage to a player, if that player attacked you during his or her last turn, exile target nonland permanent that player controls.", - "cmc": 6, - "power": "6", - "toughness": "6" - }, - { - "name": "The Ur-Dragon", - "manaCost": "4WUBRG", - "number": "0", - "rarity": "Mythic Rare", - "type": "Legendary Creature - Dragon Avatar", - "url": "http://mythicspoiler.com/c17/cards/theurdragon.jpg", - "text": "Eminence - As long as The Ur-Dragon is the command zone or on the battlefield, other Dragon spells you cast cost {1} less to cast.\nFlying\nWhenever one or more Dragons you control attack, draw that many cards, then you may put a permanent card from your hand onto the battlefield.", - "cmc": 9, - "power": "10", - "toughness": "10" - }, - { - "name": "Wasitora, Nekoru Queen", - "manaCost": "2BRG", - "number": "0", - "rarity": "Rare", - "type": "Legendary Creature - Cat Dragon", - "url": "http://mythicspoiler.com/c17/cards/wasitoranekoruqueen.jpg", - "text": "Flying, trample\nWhenever Wasitora, Nekoru Queen deals combat damage to a player, that player sacrifices a creature. If the player can't, you create a 3/3 black, red, and green Cat Dragon creature token with flying.", - "cmc": 5, - "power": "5", - "toughness": "4" - } - ] - } -} diff --git a/cards_manual.yml b/cards_manual.yml new file mode 100644 index 00000000..1b2e7deb --- /dev/null +++ b/cards_manual.yml @@ -0,0 +1,320 @@ +HOU: + - + name: Nicol Bolas, God-Pharaoh + manaCost: 4UBR + number: 140 + rarity: Mythic Rare + type: Planeswalker - Bolas + url: https://i.imgur.com/DTNXG2z.png + text: "+2: Target opponent exiles cards from the top of his or her library until he or she exiles a nonland card. Until end of turn, you may cast that card without paying its mana cost.\n+1: Each opponent exiles two cards from his or her hand.\n-4: Nicol Bolas, God-Pharaoh deals 7 damage to target opponent or creature an opponent controls.\n-12: Exile each nonland permanent your opponents control." + loyalty: 7 + cmc: 7 + - + name: Bontu's Last Reckoning + manaCost: 1BB + number: 60 + rarity: Rare + type: Sorcery + url: https://i.imgur.com/HOjh3pE.png + text: Destroy all creatures. Lands you control don't untap during your next untap step. + cmc: 3 + - + name: Samut, the Tested + manaCost: 2RG + number: 144 + rarity: Mythic Rare + type: Planeswalker - Samut + url: https://i.imgur.com/4tRYs5z.png + text: "+1: Up to one target creature gains double strike until end of turn.\n-2: Samut, the Tested deals 2 damage divided as you choose among one or two target creatures and/or players.\n-7: Search your library for up to two creature and/or planeswalker cards, put them onto the battlefield, then shuffle your library." + loyalty: 4 + cmc: 4 + - + name: Nicol Bolas, the Deceiver + manaCost: 5UBR + number: 205 + rarity: Mythic Rare + type: Planeswalker - Bolas + url: http://mythicspoiler.com/hou/cards/nicolbolasthedeceiver.jpg + text: "+3: Each opponent loses 3 life unless that player sacrifices a nonland permanent or discards a card.\n-3: Destroy a creature. Draw a card.\n-11: Nicol Bolas, the Deciever deals 7 damage to each opponent. You draw seven cards." + loyalty: 5 + cmc: 8 +XLN: + - + name: Haven Raptor + manaCost: 2GG + number: 0 + rarity: Rare + type: Creature - Dinosaur + url: http://mythicspoiler.com/ixa/cards/havenraptor.jpg + text: Tough - Whenever Haven Raptor is dealt damage, draw a card. + cmc: 4 + power: 4 + toughness: 5 + - + name: Tiehana, Voice of Thunder + manaCost: 0 + number: 0 + rarity: Rare + type: Legendary Creature - Merfolk + url: http://mythicspoiler.com/ixa/cards/tiehanavoiceofthunder.jpg + text: Tiehana, Voice of Thunder's power and toughness are equal to the number of cards in your hand.\nYou have no maximum hand size.\nWhen Tiehana enters the battlefield, draw a card for each creature you control. + cmc: 0 + power: "*" + toughness: "*" + - + name: Ogre Hand Ravager + manaCost: 3BB + number: 0 + rarity: Rare + type: Creature - Orc Pirate Wizard + url: http://mythicspoiler.com/ixa/cards/ogrehandravager.jpg + text: When Ogre Hand Ravager enters the battlefield, each player loses a third of his or her life, rounded up. + cmc: 5 + power: 4 + toughness: 4 + - + name: Bishop of Rebirth + manaCost: 3WW + number: 0 + rarity: Rare + type: Creature - Vampire Cleric + url: http://mythicspoiler.com/ixa/cards/bishopofrebirth.jpg + text: Whenever Bishop of Rebirth attacks, you may return target creature card with converted mana cost 3 or less from your graveyard to the battlefield. + cmc: 5 + power: 3 + toughness: 4 + - + name: Ashes of the Abhorrent + manaCost: 1W + number: 0 + rarity: Rare + type: Enchantment + url: http://mythicspoiler.com/ixa/cards/ashesoftheabhorrent.jpg + text: Players can't cast spells from graveyards or active abilities of cards in graveyards.\nWhenever a creature dies, you gain 1 life. + cmc: 2 + - + name: Deeproot Champion + manaCost: 1G + number: 0 + rarity: Rare + type: Creature - Merfolk Champion + url: http://mythicspoiler.com/ixa/cards/deeprootchampion.jpg + text: Whenever you cast a noncreature spell, put a +1/+1 counter on Deeproot Champion. + cmc: 2 + power: 1 + toughness: 1 + - + name: Dreamcaller Siren + manaCost: 3UU + number: 0 + rarity: Rare + type: Creature - Siren Pirate + url: http://mythicspoiler.com/ixa/cards/dreamcallersiren.jpg + text: Flash\nFlying\nDreamcaller Siren can only block creatures with flying.\nWhen Dreamcaller Siren enters the battlefield, if you control another Pirate, tap up to two target nonland permanents. + cmc: 5 + power: 3 + toughness: 3 + - + name: Goring Ceratops + manaCost: 5WW + number: 0 + rarity: Rare + type: Creature - Dinosaur + url: http://mythicspoiler.com/ixa/cards/goringceratops.jpg + text: Double strike\nWhenever Goring Ceratops attacks, other creatures you control gain double strike until end of turn. + cmc: 7 + power: "?" + toughness: "?" + - + name: Hostage Taker + manaCost: 2UB + number: 0 + rarity: Rare + type: Creature - Human Pirate + url: http://mythicspoiler.com/ixa/cards/hostagetaker.jpg + text: When Hostage Taker enters the battlefield, exile target artifact or creature until Hostage Taker leaves the battlefield. You may cast that card for as long as it remains exiled, and you may spend mana as though it were mana of any color to cast that spell. + cmc: 4 + power: 2 + toughness: 1 + - + name: Emperor's Vnguard + manaCost: 5G + number: 0 + rarity: Rare + type: Creature - Unknown + url: http://mythicspoiler.com/ixa/cards/emperorsvanguard.jpg + text: Whenever Emperor's Vanguard ??? + cmc: 6 + power: 4 + toughness: 3 + - + name: Drowned Catacomb + number: 0 + rarity: Rare + type: Land + url: http://mythicspoiler.com/ixa/cards/drownedcatacomb.jpg + text: "Drowned Catacomb enters the battlefield tapped unless you control an Island or Swamp.\n{T}: Add {U} or {B} to your mana pool." + cmc: 0 + - + name: Dragonskull Summit + number: 0 + rarity: Rare + type: Land + url: http://mythicspoiler.com/ixa/cards/dragonskullsummit.jpg + text: "Dragonskull Summit enters the battlefield tapped unless you control a Swamp or Mountain.\n{T}: Add {B} or {R} to your mana pool." + cmc: 0 + - + name: Ruin Raider + manaCost: 2B + number: 0 + rarity: Rare + type: Creature - Orc Pirate + url: http://mythicspoiler.com/ixa/cards/ruinraider.jpg + text: Raid - At the beginning of your end step, if you attacked with a creature this turn, reveal the top card of your library and put that card into your hand. You lose life equal to that card's converted mana cost. + cmc: 3 + power: "?" + toughness: "?" + - + name: Vraska's Contempt + manaCost: 2BB + number: 0 + rarity: Rare + type: Instant + url: http://mythicspoiler.com/ixa/cards/vraskascontempt.jpg + text: Exile target creature or planeswalker. You gain 2 life. + cmc: 4 + - + name: Rowdy Crew + manaCost: 3RR + number: 0 + rarity: Mythic Rare + type: Creature - Goblin Pirate + url: http://mythicspoiler.com/ixa/cards/rowdycrew.jpg + text: Trample\nWhen Rowdy Crew enters the battlefield, draw three cards, then discard 2 cards at random. If two cards that share a type are discarded this way, put two +1/+1 counters on Rowdy Crew. + cmc: 5 + power: 3 + toughness: 3 + - + name: Bloodstained Paladin + manaCost: 3B + number: 0 + rarity: Rare + type: Creature - Vampire Knight + url: http://mythicspoiler.com/ixa/cards/bloodstainedpaladin.jpg + text: Flash\nBloodstained Paladin enters the battlefield with a +1/+1 counter on it for each creature that died this turn. + cmc: 4 + power: 3 + toughness: 4 + - + name: Arcane Adaptation + manaCost: 2U + number: 44 + rarity: Mythic Rare + type: Enchantment + url: http://mythicspoiler.com/ixa/cards/arcaneadaptation.jpg + text: As Arcane Adaptation enters the battlefield, choose a creature type.\nCreatures you control are the chosen type in addition to their other types. The same is true for creature spells you control and creature cards you own that aren't on the battlefield. + cmc: 3 + - + name: Captain Lannery Storm + manaCost: 2R + number: 0 + rarity: Mythic Rare + type: Legendary Creature - Human Pirate + url: http://mythicspoiler.com/ixa/cards/captainlannerystorm.jpg + text: "Haste\nWhenever Captain Lannery Storm attacks, create a colorless Treasure artifact token with \"{T}, Sacrifice this artifact: Add one mana of any color to your mana pool.\"\nWhenever you sacrifice a Treasure, Captain Lannery Storm gets +1/+0 until end of turn." + cmc: 3 + power: 2 + toughness: 2 + - + name: Daring Saboteur + manaCost: 1U + number: 0 + rarity: Rare + type: Creature - Human Pirate + url: http://mythicspoiler.com/ixa/cards/daringsaboteur.jpg + text: "{2}{U}: Daring Saboteur can't be blocked this turn.\nWhenever Daring Saboteur deals combat damage to a player, you may draw a card. If you do, discard a card." + cmc: 2 + power: "?" + toughness: "?" + - + name: Sorcerous Spyglass + manaCost: 2 + number: 0 + rarity: Rare + type: Artifact + url: http://mythicspoiler.com/ixa/cards/sorcerousspyglass.jpg + text: As Sorcerous Spyglass enters the battlefield, look at an opponent's hand, then choose any card name.\nActivated abilities of sources with the chosen name can't be activated unless they're mana abilities. + cmc: 2 + - + name: Sunpetal Grove + number: 0 + rarity: Rare + type: Land + url: http://mythicspoiler.com/ixa/cards/sunpetalgrove.jpg + text: "Sunpetal Grove enters the battlefield tapped unless you control a Forest or a Plains.\n{T}: Add {G} or {W} to your mana pool." + cmc: 0 + - + name: Vanquisher's Banner + manaCost: 5 + number: 0 + rarity: Rare + type: Artifact + url: http://mythicspoiler.com/ixa/cards/vanquishersbanner.jpg + text: As Vanquisher's Banner enters the battlefield, choose a creature type.\nCreatures you control of the chosen type get +1/+1.\nWhenever you cast a creature spell of the chosen type, draw a card. + cmc: 5 +C17: + - + name: Taigam, Ojutai Master + manaCost: 2WU + number: 46 + rarity: Rare + type: Legendary Creature - Human Monk + url: http://mythicspoiler.com/c17/cards/taigamojutaimaster.jpg + text: Instant, sorcery, and Dragon spells you control can't be countered by spells or abilities.\nWhenever you cast an instant or sorcery spell from your hand, if Taigam, Ojutai Master attacked this turn, that spell gains rebound. (Exile the spell as it resolves. At the beginning of your next upkeep, you may cast that card from exile without paying its mana cost.) + cmc: 4 + power: 3 + toughness: 4 + - + name: Ramos, Dragon Engine + manaCost: 6 + number: 0 + rarity: Mythic Rare + type: Legendary Artifact Creature - Dragon + url: http://mythicspoiler.com/c17/cards/ramosdragonengine.jpg + text: "Flying\nWhenever you cast a spell, put a +1/+1 counter on Ramos, Dragon Engine for each of that spell's colors.\nRemove five +1/+1 counters from Ramos: Add {W}{W}{U}{U}{B}{B}{R}{R}{G}{G} to your mana pool. Activate this ability only once each turn." + cmc: 6 + power: 4 + toughness: 4 + - + name: O-Kagachi, Vengeful Kami + manaCost: 1WUBRG + number: 0 + rarity: Mythic Rare + type: Legendary Creature - Dragon Spirit + url: http://mythicspoiler.com/c17/cards/okagachivengefulkami.jpg + text: Flying, trample\nWhenever O-Kagachi, Vengeful Kami deals combat damage to a player, if that player attacked you during his or her last turn, exile target nonland permanent that player controls. + cmc: 6 + power: 6 + toughness: 6 + - + name: The Ur-Dragon + manaCost: 4WUBRG + number: 0 + rarity: Mythic Rare + type: Legendary Creature - Dragon Avatar + url: http://mythicspoiler.com/c17/cards/theurdragon.jpg + text: Eminence - As long as The Ur-Dragon is the command zone or on the battlefield, other Dragon spells you cast cost {1} less to cast.\nFlying\nWhenever one or more Dragons you control attack, draw that many cards, then you may put a permanent card from your hand onto the battlefield. + cmc: 9 + power: 10 + toughness: 10 + - + name: Wasitora, Nekoru Queen + manaCost: 2BRG + number: 0 + rarity: Rare + type: Legendary Creature - Cat Dragon + url: http://mythicspoiler.com/c17/cards/wasitoranekoruqueen.jpg + text: Flying, trample\nWhenever Wasitora, Nekoru Queen deals combat damage to a player, that player sacrifices a creature. If the player can't, you create a 3/3 black, red, and green Cat Dragon creature token with flying. + cmc: 5 + power: 5 + toughness: 4 diff --git a/main.py b/main.py index abe932b0..ebc352df 100644 --- a/main.py +++ b/main.py @@ -5,10 +5,10 @@ import scryfall_scraper import mythic_scraper import wizards_scraper import os -import commentjson import json import io import sys +import verify_files presets = { "isfullspoil": False, # when full spoil comes around, we only want to use WOTC images @@ -27,24 +27,10 @@ presets = { "dumpErrors": True # print the error log from out/errors.json } - -def load_json(json_file, lib_to_use): - try: - with open(json_file) as data_file: - if lib_to_use == 'commentjson': - output_file = commentjson.load(data_file) - elif lib_to_use == 'json': - output_file = json.load(data_file) - return output_file - except Exception as ex: - print "Unable to load file: " + json_file + "\nException information:\n" + str(ex.args) - sys.exit("Unable to load file: " + json_file) - - -setinfos = load_json('set_info', 'commentjson') -manual_sets = load_json('cards_manual', 'json') -card_corrections = load_json('cards_corrections', 'commentjson') -delete_cards = load_json('cards_delete', 'commentjson') +setinfos = verify_files.load_file('set_info.yml','yaml_multi') +manual_sets = verify_files.load_file('cards_manual.yml','yaml') +card_corrections = verify_files.load_file('cards_corrections.yml','yaml') +delete_cards = verify_files.load_file('cards_delete.yml','yaml') errorlog = [] @@ -105,7 +91,7 @@ if __name__ == '__main__': combinedjson = {} for setinfo in setinfos: if setinfo['setname'] in AllSets: - print "Found set from set_info " + setinfo['setname'] + " in MTGJSON, not adding it" + print "Found set from set_info.yml " +setinfo['setname']+ " in MTGJSON, not adding it" continue if presets['oldRSS'] or 'noRSS' in setinfo and setinfo['noRSS']: mtgs = {"cards": []} @@ -115,7 +101,7 @@ if __name__ == '__main__': [mtgs, split_cards] = mtgs_scraper.parse_mtgs( mtgs, [], [], [], presets['split_cards']) # parse spoilers into mtgjson format mtgs = spoilers.correct_cards( - mtgs, manual_sets[setinfo['setname']]['cards'], card_corrections, delete_cards) # fix using the fixfiles + mtgs, manual_sets[setinfo['setname']], card_corrections, delete_cards['delete']) # fix using the fixfiles mtgjson = spoilers.get_image_urls( mtgs, presets['isfullspoil'], setinfo['setname'], setinfo['setlongname'], setinfo['setsize'], setinfo) # get images if presets['scryfallComparison']: diff --git a/requirements.txt b/requirements.txt index be21337b..66cb7cbc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,4 +4,4 @@ lxml Pillow datetime beautifulsoup4 -commentjson +PyYAML diff --git a/set_info b/set_info deleted file mode 100644 index 2704778b..00000000 --- a/set_info +++ /dev/null @@ -1,39 +0,0 @@ -[{ - "setname": "HOU", - "setlongname": "Hour of Devastation", - "blockname": "Amonkhet", - "setsize": 199, - "setreleasedate": "2017-07-14", - "settype": "expansion", - "mtgsurl": "http://www.mtgsalvation.com/spoilers/183-hour-of-devastation", - "mtgscardpath": "http://www.mtgsalvation.com/cards/hour-of-devastation/", - "fullSpoil": false, - "masterpieces": { - "setname": "MPS_AKH", - "setlongname": "Masterpiece Series: Amonkhet Invocations", - "setreleasedate": "2017-04-28", - "alternativeNames": ["Amonkhet Invocations"], - "galleryURL": "http://magic.wizards.com/en/articles/archive/feature/masterpiece-series-hour-devastation-invocations-2017-06-19", - "additionalCardNames": [], - "mtgsurl": "http://www.mtgsalvation.com/spoilers/181-amonkhet-invocations", - "mtgscardpath": "http://www.mtgsalvation.com/cards/amonkhet-invocations/" - } -}, -{ - "setname": "XLN", - "setlongname": "Ixalan", - "blockname": "Ixalan", - "setsize": 279, - "setreleasedate": "2017-09-29", - "settype": "expansion", - "noRSS": true -}, -{ - "setname": "C17", - "setlongname": "Commander 2017", - "setsize": 309, - "setreleasedate": "2017-09-29", - "settype": "commander", - "noRSS": true, - "noBooster": true -}] \ No newline at end of file diff --git a/set_info.yml b/set_info.yml new file mode 100644 index 00000000..c03d0b88 --- /dev/null +++ b/set_info.yml @@ -0,0 +1,60 @@ +# Each new set should be separated by three dashes "---" +# +# required keys +# +# setname: FSN +# setlongname: "Full Set Name" +# setsize: 274 +# setreleasedate: "2050-02-28" +# settype: expansion +# +# optional keys +# +# blockname: "Block Name" +# mtgsurl: "http://url_to_mtgsalvation.com/spoilers/page +# mtgscardpath "http://url_to_mtgsalvation.com/cards/setpage/" +# fullSpoil: false +# masterpieces: +# +# Masterpieces contain setname, setlongname, setreleasedate as above +# and requires mtgsurl and mtgscardpath +# also can contain +# +# alternativeNames: ["Same as set long name, but minus 'Masterpiece Series:'"] +# + +--- +setname: "HOU" +setlongname: "Hour of Devastation" +blockname: "Amonkhet" +setsize: 199 +setreleasedate: "2017-07-14" +settype: "expansion" +mtgsurl: "http://www.mtgsalvation.com/spoilers/183-hour-of-devastation" +mtgscardpath: "http://www.mtgsalvation.com/cards/hour-of-devastation/" +fullSpoil: false +masterpieces: + setname: "MPS_AKH" + setlongname: "Masterpiece Series: Amonkhet Invocations" + setreleasedate: "2017-04-28" + alternativeNames: ["Amonkhet Invocations"] + galleryURL: "http://magic.wizards.com/en/articles/archive/feature/masterpiece-series-hour-devastation-invocations-2017-06-19" + additionalCardNames: [] + mtgsurl: "http://www.mtgsalvation.com/spoilers/181-amonkhet-invocations" + mtgscardpath: "http://www.mtgsalvation.com/cards/amonkhet-invocations/" +--- +setname: "XLN" +setlongname: "Ixalan" +blockname: "Ixalan" +setsize: 279 +setreleasedate: "2017-09-29" +settype: "expansion" +noRSS: true +--- +setname: "C17" +setlongname: "Commander 2017" +setsize: 309 +setreleasedate: "2017-09-29" +settype: "commander" +noRSS: true +noBooster: true \ No newline at end of file diff --git a/spoilers.py b/spoilers.py index 77c9d575..191e7201 100644 --- a/spoilers.py +++ b/spoilers.py @@ -12,14 +12,20 @@ import xml.dom.minidom def correct_cards(mtgjson, manual_cards=[], card_corrections=[], delete_cards=[]): mtgjson2 = [] for card in manual_cards: + if 'manaCost' in card: + card['manaCost'] = str(card['manaCost']) + if 'number' in card: + card['number'] = str(card['number']) if 'cmc' not in card: workingCMC = 0 - stripCost = card['manaCost'].replace('{', '').replace('}', '') - for manaSymbol in stripCost: - if manaSymbol.isdigit(): - workingCMC += int(manaSymbol) - elif not manaSymbol == 'X': - workingCMC += 1 + if 'manaCost' in card: + stripCost = card['manaCost'].replace('{','').replace('}','') + for manaSymbol in stripCost: + if manaSymbol.isdigit(): + workingCMC += int(manaSymbol) + elif not manaSymbol == 'X': + workingCMC += 1 + card['cmc'] = workingCMC if 'types' not in card: card['types'] = [] workingtypes = card['type'] @@ -44,7 +50,7 @@ def correct_cards(mtgjson, manual_cards=[], card_corrections=[], delete_cards=[] } if 'manaCost' in card: if 'text' in card and not 'Devoid' in card['text']: - for letter in card['manaCost']: + for letter in str(card['manaCost']): if not letter.isdigit() and not letter == 'X': if 'colorIdentity' in card: if not letter in card['colorIdentity']: @@ -430,7 +436,7 @@ def write_xml(mtgjson, setname, setlongname, setreleasedate, split_cards=[]): tablerow = "2" if 'number' in card: - if 'b' in card['number']: + if 'b' in str(card['number']): if 'layout' in card: if card['layout'] == 'split' or card['layout'] == 'aftermath': # print "We're skipping " + card['name'] + " because it's the right side of a split card" diff --git a/verify_files.py b/verify_files.py index f1664eb1..25848498 100644 --- a/verify_files.py +++ b/verify_files.py @@ -1,29 +1,24 @@ -import commentjson +import yaml import sys -try: - with open('set_info') as data_file: - setinfos = commentjson.load(data_file) -except Exception as ex: - print "Unable to load file: set_info\nException information:\n" + str(ex.args) - sys.exit("Unable to load file: set_info") -try: - with open('cards_manual') as data_file: - manual_sets = commentjson.load(data_file) -except Exception as ex: - print "Unable to load file: cards_manual\nException information:\n" + str(ex.args) - sys.exit("Unable to load file: cards_manual") -try: - with open('cards_corrections') as data_file: - card_corrections = commentjson.load(data_file) -except Exception as ex: - print "Unable to load file: cards_corrections\nException information:\n" + str(ex.args) - sys.exit("Unable to load file: cards_corrections") -try: - with open('cards_delete') as data_file: - delete_cards = commentjson.load(data_file) -except Exception as ex: - print "Unable to load file: cards_delete\nException information:\n" + str(ex.args) - sys.exit("Unable to load file: cards_delete") +def load_file(input_file, lib_to_use): + try: + with open(input_file) as data_file: + if lib_to_use == 'yaml': + output_file = yaml.safe_load(data_file) + elif lib_to_use == 'yaml_multi': + output_file = [] + for doc in yaml.safe_load_all(data_file): + output_file.append(doc) + return output_file + except Exception as ex: + print "Unable to load file: " + input_file + "\nException information:\n" + str(ex.args) + sys.exit("Unable to load file: " + input_file) -print "Pre-flight: All input files loaded successfully." \ No newline at end of file +if __name__ == '__main__': + setinfos = load_file('set_info.yml','yaml_multi') + manual_sets = load_file('cards_manual.yml','yaml') + card_corrections = load_file('cards_corrections.yml','yaml') + delete_cards = load_file('cards_delete.yml','yaml') + + print "Pre-flight: All input files loaded successfully." \ No newline at end of file