diff --git a/database.py b/database.py index 6c0285b..9003124 100644 --- a/database.py +++ b/database.py @@ -40,7 +40,7 @@ class TextDB(Database): } elif card and line: # Load the data into the card - if not card['cost'] and re.match('^X?\d*[{0}]*$'.format(' '.join(Mana.types.keys())), line): + if not card['cost'] and re.match('^X?\d*(\((\d+|[{0}])/(\d+|[{0}])\))*[{0}]*$'.format(''.join(Mana.types.keys())), line.upper()): card['cost'] = line continue elif not card['type']: @@ -93,10 +93,5 @@ class WagicDB(Database): if __name__ == '__main__': db = TextDB('db.txt') - deck = Deck() - deck.load('decks/BlackSiege.txt', db) - - wagic = Deck() - w = WagicDB('/home/correlr/Download/wth/PSP/GAME/WTH') - for card in deck: - wagic.append(w.getCard(card.name, card)) + c = db.getCard('Balefire Liege') + print c