MCPcopy Index your code
hub / github.com/pyfa-org/Pyfa / generalOutput

Function generalOutput

service/port/shipstats.py:51–77  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

49 # "Hull {:>7} {:>7.0%} {:>7.0%} {:>7.0%} {:>7.0%}\n".format(ehpStr[2], *resists["hull"])
50
51 def generalOutput():
52 rowNames = ["EHP"]
53 rowNames.extend(RRTypes.names(postProcessor=lambda v: v.capitalize()))
54 colNames = DmgTypes.names(short=True, postProcessor=lambda v: " " + v.capitalize())
55 colNames[0] = colNames[0][1::]
56
57 outputScheme = []
58 for index, rowName in enumerate(rowNames):
59 row = rowName + ": {:>} ("
60 subsValue = " {:.0%}," if index > 0 else " {:>},"
61
62 row += ''.join([(colName + ":" + subsValue) for colName in colNames])
63 row = row[:-1:] + ")\n"
64
65 outputScheme.append(row)
66
67 return \
68 outputScheme[0].format(ehpStr[3], *ehpAgainstDamageTypeStr) + \
69 outputScheme[1].format(ehpStr[0], *resists["shield"]) + \
70 outputScheme[2].format(ehpStr[1], *resists["armor"]) + \
71 outputScheme[3].format(ehpStr[2], *resists["hull"])
72
73 # return \
74 # "EHP: {:>} (Em: {:>}, Th: {:>}, Kin: {:>}, Exp: {:>})\n".format(ehpStr[3], *ehpAgainstDamageTypeStr) + \
75 # "Shield: {:>} (Em: {:.0%}, Th: {:.0%}, Kin: {:.0%}, Exp: {:.0%})\n".format(ehpStr[0], *resists["shield"]) + \
76 # "Armor: {:>} (Em: {:.0%}, Th: {:.0%}, Kin: {:.0%}, Exp: {:.0%})\n".format(ehpStr[1], *resists["armor"]) + \
77 # "Hull: {:>} (Em: {:.0%}, Th: {:.0%}, Kin: {:.0%}, Exp: {:.0%})\n".format(ehpStr[2], *resists["hull"])
78
79 return generalOutput()
80

Callers 1

tankSectionFunction · 0.85

Calls 2

namesMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected