Skip to content

Commit e4a8ed8

Browse files
committed
Fixed bug with bed counts
1 parent ed52f1a commit e4a8ed8

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
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.5.1:
10+
11+
2.5.1 (2020-05-27)
12+
==================
13+
- Fixed bed count not being parsed on houses.
14+
915
.. _v2.5.0:
1016

1117
2.5.0 (2020-05-22)

tibiapy/__init__.py

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

17-
__version__ = '2.5.0'
17+
__version__ = '2.5.1'
1818

1919
from logging import NullHandler
2020

tibiapy/house.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
)
1818

1919
id_regex = re.compile(r'house_(\d+)\.')
20-
bed_regex = re.compile(r'This (?P<type>\w+) has (?P<beds>[\w-]+) bed')
20+
bed_regex = re.compile(r'This (?P<type>\w+) can have up to (?P<beds>[\d-]+) bed')
2121
info_regex = \
2222
re.compile(r'The house has a size of (?P<size>\d+) square meter[s]?. '
2323
r'The monthly rent is (?P<rent>\d+k?) gold and will be debited to the bank account on (?P<world>\w+).')
@@ -178,8 +178,7 @@ def from_content(cls, content):
178178
house.type = HouseType.GUILDHALL
179179
else:
180180
house.type = HouseType.HOUSE
181-
beds_word = m.group("beds")
182-
house.beds = parse_number_words(beds_word)
181+
house.beds = int(m.group("beds"))
183182

184183
m = info_regex.search(info)
185184
if m:

0 commit comments

Comments
 (0)