MCPcopy Create free account
hub / github.com/Card-Forge/forge / initializeForgeCards

Function initializeForgeCards

forge-gui/tools/EditionTracking.py:109–130  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

107
108
109def initializeForgeCards():
110 #Parse Forge
111 print("Parsing Forge")
112 cardsfolderLocation = os.path.join(resDir, 'cardsfolder')
113 for root, dirnames, filenames in os.walk(cardsfolderLocation):
114 for fileName in fnmatch.filter(filenames, '*.txt'):
115 with open(os.path.join(root, fileName)) as currentForgeCard :
116 # Check all names for this card
117 name = ''
118 split = False
119 for line in currentForgeCard.readlines():
120 if line.startswith("Name:"):
121 if split:
122 name += ' // '
123
124 if not name or split:
125 name += line[5:].rstrip().lower()
126
127 elif line.startswith("AlternateMode") and 'Split' in line:
128 split = True
129
130 forgeCards.append(name)
131
132def initializeFormats():
133 formats = {}

Callers 1

EditionTracking.pyFile · 0.85

Calls 4

walkMethod · 0.80
joinMethod · 0.45
filterMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected