Skip to content

Commit 6ae8185

Browse files
authored
Merge pull request #21 from Galarzaa90/dev
v2.3.1
2 parents 04944c3 + da4f2ea commit 6ae8185

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

CHANGELOG.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ Changelog
66
Due to this library relying on external content, older versions are not guaranteed to work.
77
Try to always use the latest version.
88

9+
.. _v2.3.1:
10+
11+
2.3.1 (2019-10-06)
12+
==================
13+
- Fixed a bug with deaths not being parsed when a killer had ``and`` in their name.
14+
915
.. _v2.3.0:
1016

1117
2.3.0 (2019-09-16)

tests/tests_world.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ def test_world_tibiadata_unrelated_section(self):
215215

216216
# region TibiaData WorldOverview Tests
217217

218-
def test_world_overview_from_content(self):
218+
def test_world_overview_from_content_tibiadata(self):
219219
"""Testing parsing the world overview from TibiaData"""
220220
content = self._load_resource(FILE_WORLD_LIST_TIBIADATA)
221221
world_overview = WorldOverview.from_tibiadata(content)
@@ -230,7 +230,7 @@ def test_world_overview_from_content(self):
230230
self.assertIsInstance(world_overview.worlds[0].location, WorldLocation)
231231
self.assertIsInstance(world_overview.worlds[0].online_count, int)
232232

233-
def test_world_overview_from_content_offline(self):
233+
def test_listed_world_list_from_tibiadata_offline(self):
234234
"""Testing parsing the world overview with offline worlds"""
235235
content = self._load_resource(FILE_WORLD_LIST_TIBIADATA_OFFLINE)
236236
worlds = ListedWorld.list_from_tibiadata(content)
@@ -243,13 +243,13 @@ def test_world_overview_from_content_offline(self):
243243
self.assertIsInstance(worlds[0].location, WorldLocation)
244244
self.assertIsInstance(worlds[0].online_count, int)
245245

246-
def test_world_overview_from_content_unrelated(self):
246+
def test_listed_world_list_from_tibiadata_unrelated(self):
247247
"""Testing parsing an unrelated json"""
248248
content = self._load_resource(FILE_WORLD_TIBIADATA)
249249
with self.assertRaises(InvalidContent):
250250
ListedWorld.list_from_tibiadata(content)
251251

252-
def test_world_overview_from_content_invalid_json(self):
252+
def test_listed_world_list_from_tibiadata_invalid_json(self):
253253
"""Testing parsing an invalid json"""
254254
with self.assertRaises(InvalidContent):
255255
ListedWorld.list_from_tibiadata("<html><b>Not a json string</b></html>")

tibiapy/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from tibiapy.creature import *
1414
from tibiapy.client import *
1515

16-
__version__ = '2.3.0'
16+
__version__ = '2.3.1'
1717

1818
from logging import NullHandler
1919

tibiapy/character.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
death_assisted = re.compile(r'(?P<killers>.+)\.<br/>Assisted by (?P<assists>.+)')
2323
# From a killer entry, extracts the summoned creature
2424
death_summon = re.compile(r'(?P<summon>.+) of <a[^>]+>(?P<name>[^<]+)</a>')
25+
link_search = re.compile(r'<a[^>]+>[^<]+</a>')
2526
# Extracts the contents of a tag
2627
link_content = re.compile(r'>([^<]+)<')
2728
# Extracts reason from TibiaData death
@@ -551,7 +552,8 @@ def _parse_deaths(self, rows):
551552
# Filter out assists
552553
killers_desc = assist_match.group("killers")
553554
# Split assists into a list.
554-
assists_name_list = self._split_list(assist_match.group("assists"))
555+
assists_desc = assist_match.group("assists")
556+
assists_name_list = link_search.findall(assists_desc)
555557
killers_name_list = self._split_list(killers_desc)
556558
for killer in killers_name_list:
557559
killer_dict = self._parse_killer(killer)

0 commit comments

Comments
 (0)