diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2017-01-24 12:02:00 +0100 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2017-01-24 12:02:00 +0100 |
| commit | 3ccef39f3fe7c995abd3a7b429bf8e134661097a (patch) | |
| tree | bdf801bfe14b111ef888e610c7dc28d8970177b7 /examples/dashboard | |
| parent | 8b0b01aa4cbb645bfcecc5b6579b34a213389db1 (diff) | |
| download | python-gamelocker-3ccef39f3fe7c995abd3a7b429bf8e134661097a.tar.gz python-gamelocker-3ccef39f3fe7c995abd3a7b429bf8e134661097a.zip | |
remove string hacks
Diffstat (limited to 'examples/dashboard')
| -rw-r--r-- | examples/dashboard/app.py | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/examples/dashboard/app.py b/examples/dashboard/app.py index 35f6332..f256f10 100644 --- a/examples/dashboard/app.py +++ b/examples/dashboard/app.py @@ -59,28 +59,28 @@ def data(): players[participant.player.name] = 0 players[participant.player.name] += 1 - if participant.actor.pretty() not in heroes: - heroes[participant.actor.pretty()] = 0 - heroes[participant.actor.pretty()] += 1 + if gamelocker.pretty(participant.actor) not in heroes: + heroes[gamelocker.pretty(participant.actor)] = 0 + heroes[gamelocker.pretty(participant.actor)] += 1 # TODO use id instead of name? - playersactors[participant.player.name] = participant.actor.pretty() - cs[participant.player.name] = participant.stats.minionKills / match.duration * 60 - minions += participant.stats.minionKills + playersactors[participant.player.name] = gamelocker.pretty(participant.actor) + cs[participant.player.name] = participant.stats["minionKills"] / match.duration * 60 + minions += participant.stats["minionKills"] - for item in participant.stats.items: - if item.pretty() in ["Sprint Boots", "Travel Boots", "Journey Boots", "War Treads", "Halcyon Chargers"]: + for item in participant.stats["items"]: + if gamelocker.pretty(item) in ["Sprint Boots", "Travel Boots", "Journey Boots", "War Treads", "Halcyon Chargers"]: boots += 1 - for item in participant.stats.itemUses: - if gamelocker.strings.LazyObject(item).pretty() == "Halcyon Potion": - potions += participant.stats.itemUses[item] + for item in participant.stats["itemUses"]: + if gamelocker.pretty(item) == "Halcyon Potion": + potions += participant.stats["itemUses"][item] - for sold in participant.stats.itemSells: - item = gamelocker.strings.LazyObject(sold).pretty() + for sold in participant.stats["itemSells"]: + item = gamelocker.pretty(sold) if not item in sells: sells[item] = 0 - sells[item] += participant.stats.itemSells[sold] + sells[item] += participant.stats["itemSells"][sold] sells = sorted(sells.items(), key=lambda x: x[1], reverse=True) data["topsold"] = ", ".join([s[0] for s in sells[0:3]]) |
