Improve editions for tracking scripts

This commit is contained in:
friarsol
2021-03-07 22:29:17 -05:00
parent f97c3e06ad
commit 21f2395089
5 changed files with 17 additions and 12 deletions

View File

@@ -14,6 +14,7 @@ allJsonUrl = 'http://mtgjson.com/json/AllCards.json'
def initializeEditions():
ignoredTypes = [ "From_the_Vault", "Duel_Decks", "Online", "Premium_Deck_Series" ]
ignoredBorders = [ "Silver" ]
editionSections = [ "[cards]", "[precon product]", "[borderless]", "[showcase]", "[extended art]", "[buy a box]", "[promo]" ]
print("Parsing Editions folder")
@@ -24,7 +25,7 @@ def initializeEditions():
with open(os.path.join(root, fileName)) as currentEdition:
# Check all names for this card
metadata = True
setcode = setname = settype = None
setcode = setname = settype = border = None
for line in currentEdition.readlines():
line = line.strip()
if metadata:
@@ -33,7 +34,7 @@ def initializeEditions():
if setcode and setcode not in setCodes:
setCodes.append(setcode)
setCodeToName[setcode] = setname
if settype in ignoredTypes:
if settype in ignoredTypes or border in ignoredBorders:
ignoredSet.append(setcode)
elif line.startswith("Code="):
@@ -45,6 +46,9 @@ def initializeEditions():
elif line.startswith("Type="):
settype = line.split("=")[1].rstrip()
elif line.startswith("Border="):
border = line.split("=")[1].rstrip()
else:
if not line:
continue