mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-14 17:58:01 +00:00
- Fixing Edition Tracking to work with Edition files changes
This commit is contained in:
@@ -17,6 +17,7 @@ def initializeEditions():
|
|||||||
for root, dirnames, filenames in os.walk(editionsDir):
|
for root, dirnames, filenames in os.walk(editionsDir):
|
||||||
for fileName in fnmatch.filter(filenames, '*.txt'):
|
for fileName in fnmatch.filter(filenames, '*.txt'):
|
||||||
#print "Parsing...", fileName
|
#print "Parsing...", fileName
|
||||||
|
hasSetNumbers = None
|
||||||
with open(os.path.join(root, fileName)) as currentEdition:
|
with open(os.path.join(root, fileName)) as currentEdition:
|
||||||
# Check all names for this card
|
# Check all names for this card
|
||||||
metadata = True
|
metadata = True
|
||||||
@@ -42,7 +43,10 @@ def initializeEditions():
|
|||||||
|
|
||||||
else:
|
else:
|
||||||
if line:
|
if line:
|
||||||
card = line.split(" ", 1)[1].replace("AE","Ae").rstrip()
|
if hasSetNumbers is None:
|
||||||
|
hasSetNumbers = line.split(" ", 1)[0].isdigit()
|
||||||
|
|
||||||
|
card = line.split(" ", 2 if hasSetNumbers else 1)[-1].replace("AE","Ae").rstrip()
|
||||||
if card not in mtgDataCards:
|
if card not in mtgDataCards:
|
||||||
#print card
|
#print card
|
||||||
mtgDataCards[card] = [setcode]
|
mtgDataCards[card] = [setcode]
|
||||||
@@ -308,8 +312,8 @@ if __name__ == '__main__':
|
|||||||
output.write( "PT:" + orc.get('power') + '/' + orc.get('toughness') + '\n')
|
output.write( "PT:" + orc.get('power') + '/' + orc.get('toughness') + '\n')
|
||||||
if 'loyalty' in orc:
|
if 'loyalty' in orc:
|
||||||
output.write('Loyalty:' + orc.get('loyalty'))
|
output.write('Loyalty:' + orc.get('loyalty'))
|
||||||
except:
|
except Exception as e:
|
||||||
print "some issue?"
|
print "some issue?", str(e)
|
||||||
|
|
||||||
# Blah
|
# Blah
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user