Skip to content

Commit d77cfec

Browse files
committed
Merge branch 'master' into dev
# Conflicts: # CHANGELOG.rst # tibiapy/__init__.py
2 parents d234227 + d1745b2 commit d77cfec

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
@@ -35,6 +35,12 @@ Changelog
3535
directly implemented by most classes.
3636

3737

38+
.. _v2.5.1:
39+
40+
2.5.1 (2020-05-27)
41+
==================
42+
- Fixed bed count not being parsed on houses.
43+
3844
.. _v2.5.0:
3945

4046
2.5.0 (2020-05-22)

tests/resources/house/tibiacom_full.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="BoxContent" style="background-image:url(https://ssl-static-tibia.akamaized.net/images/global/content/scroll.gif);">
2-
<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4><TR><TD VALIGN=top><IMG SRC="https://ssl-static-tibia.akamaized.net/images/houses/house_10509.jpg" WIDTH=150 HEIGHT=150></TD><TD VALIGN=top><B>Sorcerer's Avenue Labs 2e</B><BR>This house has one bed. Only sorcerers can enter.<BR><BR>The house has a size of <B>13 square meters</B>. The monthly rent is <B>715 gold</B> and will be debited to the bank account on <B>Antica</B>.<BR><BR>The house is currently being auctioned. The auction will end at <B>Dec&#160;18&#160;2018,&#160;10:00:00&#160;CET</B>. The highest bid so far is <B>0 gold</B> and has been submitted by <A HREF="https://www.tibia.com/community/?subtopic=characters&name=King+of+Bosnia">King&#160;of&#160;Bosnia</A>. </TD></TR></TABLE><BR><BR><TABLE BORDER=0 WIDTH=100%><TR><TD ALIGN=center><IMG SRC="https://ssl-static-tibia.akamaized.net/images/global/general/blank.gif" WIDTH=80 HEIGHT=1 BORDER=0<BR></TD><TD ALIGN=center><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><FORM ACTION=https://www.tibia.com/account/index.php?subtopic=redirectlogin&redirect=https%3A%2F%2Fwww.tibia.com%2Fcommunity%2F%3Fsubtopic%3Dhouses%26page%3Dbid%26world%3DAntica%26town%3DThais%26state%3Dauctioned%26type%3Dhouses%26order%3Dsize%26houseid%3D10509 METHOD=post><TR><TD>
2+
<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4><TR><TD VALIGN=top><IMG SRC="https://ssl-static-tibia.akamaized.net/images/houses/house_10509.jpg" WIDTH=150 HEIGHT=150></TD><TD VALIGN=top><B>Sorcerer's Avenue Labs 2e</B><BR>This house can have up to 1 bed. Only sorcerers can enter.<BR><BR>The house has a size of <B>13 square meters</B>. The monthly rent is <B>715 gold</B> and will be debited to the bank account on <B>Antica</B>.<BR><BR>The house is currently being auctioned. The auction will end at <B>Dec&#160;18&#160;2018,&#160;10:00:00&#160;CET</B>. The highest bid so far is <B>0 gold</B> and has been submitted by <A HREF="https://www.tibia.com/community/?subtopic=characters&name=King+of+Bosnia">King&#160;of&#160;Bosnia</A>. </TD></TR></TABLE><BR><BR><TABLE BORDER=0 WIDTH=100%><TR><TD ALIGN=center><IMG SRC="https://ssl-static-tibia.akamaized.net/images/global/general/blank.gif" WIDTH=80 HEIGHT=1 BORDER=0<BR></TD><TD ALIGN=center><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><FORM ACTION=https://www.tibia.com/account/index.php?subtopic=redirectlogin&redirect=https%3A%2F%2Fwww.tibia.com%2Fcommunity%2F%3Fsubtopic%3Dhouses%26page%3Dbid%26world%3DAntica%26town%3DThais%26state%3Dauctioned%26type%3Dhouses%26order%3Dsize%26houseid%3D10509 METHOD=post><TR><TD>
33
<INPUT TYPE=image NAME="Bid" ALT="Bid" SRC="https://ssl-static-tibia.akamaized.net/images/global/buttons/sbutton_bid.gif" BORDER=0 WIDTH=120 HEIGHT=18>
44
</TD></TR></FORM></TABLE>
55
</TD><TD ALIGN=center><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><FORM ACTION=https://www.tibia.com/community/?subtopic=houses METHOD=post><TR><TD>

tibiapy/house.py

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

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

188187
m = info_regex.search(info)
189188
if m:

0 commit comments

Comments
 (0)