Commit 90f4cf28 authored by Adrien Simon's avatar Adrien Simon
Browse files

Problème de personnes qui avaient quitté la conversation reglé

parent 0fdae6cd
......@@ -23,7 +23,10 @@ def counttalk(data):
participants[participant] = 0
for msg in messages:
if not msg["is_unsent"]:
participants[decode.string_decode(msg["sender_name"])] += 1
try:
participants[decode.string_decode(msg["sender_name"])] += 1
except KeyError:
participants["Autres"] += 1
for nb_talk in participants:
print(nb_talk + " : " + str(participants[nb_talk]))
......@@ -65,7 +68,10 @@ def countunset(data):
participants[participant] = 0
for msg in messages:
if msg["is_unsent"]:
participants[decode.string_decode(msg["sender_name"])] += 1
try:
participants[decode.string_decode(msg["sender_name"])] += 1
except KeyError:
participants["Autres"] += 1
for nb_unsent in participants:
print(nb_unsent + " : " + str(participants[nb_unsent]))
......
......@@ -24,4 +24,5 @@ def userdico(data):
userdict = {}
for participant in data["participants"]:
userdict[decode.string_decode(participant["name"])] = None
userdict["Autres"] = None
return userdict
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment