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

Function printOverallEditions

forge-gui/tools/EditionTracking.py:176–198  ·  view source on GitHub ↗
(totalDataList, setCodeToName, releaseFile=None)

Source from the content-addressed store, hash-verified

174 f.write(text)
175
176def printOverallEditions(totalDataList, setCodeToName, releaseFile=None):
177 totalPercentage = 0
178 totalMissing = 0
179 totalImplemented = 0
180 fullTotal = 0
181 if releaseFile:
182 releaseFile.write("[spoiler=Overall Editions]\n")
183 with open(os.path.join(toolsDir, "EditionTrackingResults", "CompleteStats.txt"), "w") as statsfile:
184 files = [statsfile, releaseFile]
185 writeToFiles("Set: Implemented (Missing) / Total = Percentage Implemented\n", files)
186 for k,dataKey in totalDataList :
187 totalImplemented += dataKey[0]
188 totalMissing += dataKey[1]
189 fullTotal += dataKey[2]
190 if dataKey[2] == 0:
191 print("SetCode unknown", k)
192 continue
193 writeToFiles(setCodeToName[k].lstrip() + ": " + str(dataKey[0]) + " (" + str(dataKey[1]) + ") / " + str(dataKey[2]) + " = " + str(round(dataKey[3], 2)) + "%\n", files)
194 totalPercentage = totalImplemented / fullTotal
195 writeToFiles("\nTotal over all sets: " + str(totalImplemented) + " (" + str(totalMissing) + ") / " + str(fullTotal) + "\n", files)
196
197 if releaseFile:
198 releaseFile.write("[/spoiler]\n\n")
199
200def printCardSet(implementedSet, missingSet, fileName, setCoverage=None, printImplemented=False, printMissing=True, releaseFile=None):
201 # Add another file that will print out whichever set is requested

Callers 1

EditionTracking.pyFile · 0.70

Calls 3

writeToFilesFunction · 0.70
writeMethod · 0.65
joinMethod · 0.45

Tested by

no test coverage detected