Fixes to the database card generator. Default value for card name, fixed broken db read logic

This commit is contained in:
Correl Roush 2010-08-26 00:30:26 -04:00
parent 88590e67a8
commit cf0571ba41

View file

@ -17,7 +17,7 @@ class TextDB(Database):
self.filename = filename
def getCard(self, name):
return self.findCard(name).next()
def findCard(self, name):
def findCard(self, name=None):
card = None
with open(self.filename, 'r') as f:
inRecord = False
@ -63,9 +63,8 @@ class TextDB(Database):
if card:
# We're done here
yield Card(card['name'], card['type'], card['attributes'], card['cost'], card['power'], card['toughness'], card['sets'], card['rarity'], card['text'])
else:
# Prepare to read in the next record
inRecord = False
# Prepare to read in the next record
inRecord = False
class WagicDB(Database):
def __init__(self, wagicPath):