# Path: MTG/cardtype.py
# class SuperType(Enum):
# class CardType(Enum):
# class LandType(Enum):
#     BASIC = 0
#     LEGENDARY = 1
#     SNOW = 2
#     WORLD = 3
#     ARTIFACT = 0
#     CREATURE = 1
#     ENCHANTMENT = 2
#     INSTANT = 3
#     LAND = 4
#     PLANESWALKER = 5
#     SORCERY = 6
#     TRIBAL = 7
#     PLAINS = 0
#     ISLAND = 1
#     SWAMP = 2
#     MOUNTAIN = 3
#     FOREST = 4
# 
# Path: MTG/static_abilities.py
# class StaticAbilities(Enum):


import re, sys, traceback
import pickle
from bs4 import BeautifulSoup
from MTG import cardtype
from MTG import static_abilities

    card_list = soup.cockatrice_carddatabase.cards.find_all('card')
    cnt = 0
    fout = open("data/all_set_cards.py", "w")
    fout.write("from MTG import card\n"
        "from MTG import gameobject\n"
        "from MTG import cardtype\n"
        "from MTG import static_abilities\n"
        "from MTG import mana\n\n")

    id_to_name = {}
    name_to_id = {}

    for card in card_list:
        supertype = []
        types = []
        try:
            ID = 'c' + re.search('(?<=multiverseid=)[0-9]+', card.set['picURL']).group(0)
            name = card.find('name').text
            characteristics = {'name': name}
            characteristics['text'] = card.find('text').text
            characteristics['color'] = [c.text for c in card.find_all('color')]
            characteristics['mana_cost'] = card.find('manacost').text

            # types
            _type = card.find('type').text.split(' - ')
            if len(_type) > 1:
                characteristics['subtype'] = _type[1].split(' ')
            _type = _type[0].split(' ')


# Path: MTG/cardtype.py
# class SuperType(Enum):
# class CardType(Enum):
# class LandType(Enum):
#     BASIC = 0
#     LEGENDARY = 1
#     SNOW = 2
#     WORLD = 3
#     ARTIFACT = 0
#     CREATURE = 1
#     ENCHANTMENT = 2
#     INSTANT = 3
#     LAND = 4
#     PLANESWALKER = 5
#     SORCERY = 6
#     TRIBAL = 7
#     PLAINS = 0
#     ISLAND = 1
#     SWAMP = 2
#     MOUNTAIN = 3
#     FOREST = 4
# 
# Path: MTG/static_abilities.py
# class StaticAbilities(Enum):


# Path: parser/parse_cockatrice.py
import re, sys, traceback
import pickle
from bs4 import BeautifulSoup
from MTG import cardtype
from MTG import static_abilities


    card_list = soup.cockatrice_carddatabase.cards.find_all('card')
    cnt = 0
    fout = open("data/all_set_cards.py", "w")
    fout.write("from MTG import card\n"
        "from MTG import gameobject\n"
        "from MTG import cardtype\n"
        "from MTG import static_abilities\n"
        "from MTG import mana\n\n")

    id_to_name = {}
    name_to_id = {}

    for card in card_list:
        supertype = []
        types = []
        try:
            ID = 'c' + re.search('(?<=multiverseid=)[0-9]+', card.set['picURL']).group(0)
            name = card.find('name').text
            characteristics = {'name': name}
            characteristics['text'] = card.find('text').text
            characteristics['color'] = [c.text for c in card.find_all('color')]
            characteristics['mana_cost'] = card.find('manacost').text

            # types
            _type = card.find('type').text.split(' - ')
            if len(_type) > 1:
                characteristics['subtype'] = _type[1].split(' ')
            _type = _type[0].split(' ')


            if len(_type) > 1 and _type[0].upper() in cardtype.SuperType._member_names_: