Skip to content

Commit 6626a2b

Browse files
authored
swap Mercy to Ange in fr.json and add unknow role (#20)
1 parent d3b50f2 commit 6626a2b

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

src/log_analyser/objects/player.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ def add_character(self, data):
2020

2121
def find_role(self):
2222

23+
if self.name == "MrSully":
24+
pass
2325
roles_time = {"Tank": 0, "DPS": 0, "Support": 0}
2426
for character in self.characters:
2527
character_role = self.characters[character].role
@@ -28,4 +30,7 @@ def find_role(self):
2830
if "end" in play_time and "start" in play_time:
2931
roles_time[character_role] += float(play_time["end"]) - float(play_time["start"])
3032

31-
self.role = max(roles_time, key=roles_time.get)
33+
if sum(roles_time.values()) == 0:
34+
self.role = "Unknown"
35+
else:
36+
self.role = max(roles_time, key=roles_time.get)

src/log_analyser/roles/lg/fr.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"Kiriko": "Kiriko",
3636
"Vital": "Lifeweaver",
3737
"Lúcio": "Lúcio",
38-
"Mercy": "Mercy",
38+
"Ange": "Mercy",
3939
"Moira": "Moira",
4040
"Zenyatta": "Zenyatta"
4141
}

src/process_file.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44
for file in os.listdir("logs"):
55
if file.endswith(".txt"):
66
la = LogAnalyser('logs', file, "test")
7-
la.run()
7+
la.run()
8+
print("a")

0 commit comments

Comments
 (0)