since mtgdata.txt is a bit broken now (lacks Assault but has 2 Batteries), the script will try to use 2nd part of a card to get rarities, CM1 set enabled to fill SetInfos

This commit is contained in:
Maxmtg
2013-03-04 19:38:05 +00:00
parent 3517416a5a
commit 58fc1ae52a
2 changed files with 9 additions and 2 deletions

View File

@@ -120,16 +120,23 @@ if __name__ == '__main__':
firstLine = cardfile.readline().strip() firstLine = cardfile.readline().strip()
cardName = firstLine[5:] cardName = firstLine[5:]
altName = None
print (cardName, fileName)
validLines = [] validLines = []
validLines.append(firstLine) validLines.append(firstLine)
for line in cardfile.readlines(): for line in cardfile.readlines():
if line[:8] != "SetInfo:" and line[:8] != "SVar:Rar": if line[:8] != "SetInfo:" and line[:8] != "SVar:Rar":
validLines.append(line.strip()) validLines.append(line.strip())
if line[:5] == "Name:":
altName = line[5:].strip()
cardfile.close() cardfile.close()
print (cardName, altName, fileName)
if not cardName in mtgDataCards and not altName is None:
cardName = altName
for e in mtgDataCards[cardName]: for e in mtgDataCards[cardName]:
if not setCodeToForge[e] is None: if not setCodeToForge[e] is None:
validLines.append( "SetInfo:{} {}".format(setCodeToForge[e], mtgDataCards[cardName][e]) ) validLines.append( "SetInfo:{} {}".format(setCodeToForge[e], mtgDataCards[cardName][e]) )

View File

@@ -25,7 +25,7 @@ AQ ATQ # Antiquities
CG UDS # Urza's Destiny CG UDS # Urza's Destiny
CH CHR # Chronicles CH CHR # Chronicles
===CHK # Champions of Kamigawa ===CHK # Champions of Kamigawa
---CM1 # Commander's Arsenal ===CM1 # Commander's Arsenal
CMD COM # Magic: The Gathering-Commander CMD COM # Magic: The Gathering-Commander
CON CFX # Conflux CON CFX # Conflux
===CSP # Coldsnap ===CSP # Coldsnap