mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 10:18:01 +00:00
- Fixing the two scripts that were broken because they were expecting an End clause in card scripts
This commit is contained in:
@@ -71,8 +71,7 @@ def writeOutCard(root, fileName, lines, oracle, sets):
|
||||
else:
|
||||
cardfile.write('SetInfo:%s|%s|\n' % (setInfo[0],setInfo[1]))
|
||||
'''
|
||||
|
||||
cardfile.write('End')
|
||||
|
||||
cardfile.close()
|
||||
|
||||
|
||||
@@ -126,12 +125,12 @@ def getOracleFromMagicCardsInfo(name):
|
||||
|
||||
def hasOracleLine(cardFile, lines, offlineSource=True):
|
||||
# Start parsing the rest of the data file
|
||||
line = cardFile.readline().strip()
|
||||
hasOracle = False
|
||||
while line != 'End':
|
||||
|
||||
for line in cardFile.readlines():
|
||||
line = line.strip()
|
||||
# Skip empty lines
|
||||
if line == '':
|
||||
line = cardFile.readline().strip()
|
||||
continue
|
||||
|
||||
if line.find(oracleStr) != -1:
|
||||
@@ -144,8 +143,6 @@ def hasOracleLine(cardFile, lines, offlineSource=True):
|
||||
else:
|
||||
lines += line + '\n'
|
||||
|
||||
line = cardFile.readline().strip()
|
||||
|
||||
cardFile.close()
|
||||
return hasOracle, lines
|
||||
|
||||
|
||||
@@ -236,18 +236,12 @@ for root, dirnames, filenames in os.walk(folder):
|
||||
card.lines = line + '\n'
|
||||
|
||||
# Start parsing the rest of the data file
|
||||
line = file.readline().strip()
|
||||
|
||||
while line != 'End':
|
||||
for line in file.readlines():
|
||||
line = line.strip()
|
||||
# Skip empty lines
|
||||
if line == '':
|
||||
line = file.readline().strip()
|
||||
continue
|
||||
|
||||
# We really shouldn't
|
||||
if line == 'End':
|
||||
break
|
||||
|
||||
if line.find(setStr) != -1:
|
||||
info = line.replace('SetInfo:','')
|
||||
parts = info.split('|')
|
||||
@@ -257,8 +251,6 @@ for root, dirnames, filenames in os.walk(folder):
|
||||
else:
|
||||
card.lines += line +'\n'
|
||||
|
||||
line = file.readline().strip()
|
||||
|
||||
if not card.hasSet:
|
||||
addSets(card)
|
||||
card.hasSet = True
|
||||
@@ -269,8 +261,6 @@ for root, dirnames, filenames in os.walk(folder):
|
||||
for s in card.sets.values():
|
||||
file.write('SetInfo:'+ s.set + '|' + s.rarity + '|' + s.image + '\n')
|
||||
|
||||
file.write('End')
|
||||
|
||||
err.write(card.name + '... Updated\n')
|
||||
|
||||
file.close()
|
||||
|
||||
Reference in New Issue
Block a user