Fixes to the database card generator. Default value for card name, fixed broken db read logic
This commit is contained in:
parent
88590e67a8
commit
cf0571ba41
1 changed files with 3 additions and 4 deletions
|
@ -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,7 +63,6 @@ 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
|
||||
|
||||
|
|
Loading…
Reference in a new issue