Order Player chars list based on choices in conf()
parent
a21e8f80b6
commit
f5350d506f
|
@ -122,8 +122,15 @@ class Player():
|
|||
# -------------------------------------------------------------------------
|
||||
def conf(self):
|
||||
|
||||
# The char list looks like 'character1 (12.08), character2 (3.02)'
|
||||
# where the number between parenthesis is the number of time the
|
||||
# character was played
|
||||
charslist = ", ".join(
|
||||
[ "{} ({:.2f})".format(c,self.chars[c]) for c in self.chars ]
|
||||
[ "{} ({:.2f})".format(c,n) for c,n in sorted(
|
||||
self.chars.items(),
|
||||
key = lambda cv: cv[1],
|
||||
reverse = True,
|
||||
) ]
|
||||
)
|
||||
|
||||
return """
|
||||
|
|
Loading…
Reference in New Issue