Skip to content

Commit b29b761

Browse files
authored
Merge pull request #40 from Galarzaa90/38-rented_regex-in-house-parser-is-specifically-searching-for-houses-wrongly-parsing-guildhalls
Fix house regex not handling guildhalls
2 parents 4ca8b0b + 77a1a8f commit b29b761

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

tibiapy/builders/house.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ def build(self):
240240
beds=self._beds,
241241
owner=self._owner,
242242
owner_sex=self._owner_sex,
243+
paid_until=self._paid_until,
243244
transfer_recipient=self._transfer_recipient,
244245
transfer_price=self._transfer_price,
245246
transfer_date=self._transfer_date,

tibiapy/parsers/house.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,15 @@
2424
id_regex = re.compile(r"house_(\d+)\.")
2525
bed_regex = re.compile(r"This (?P<type>\w+) can have up to (?P<beds>[\d-]+) bed")
2626
info_regex = (
27-
re.compile(r"The house has a size of (?P<size>\d+) square meters?. "
28-
r"The monthly rent is (?P<rent>\d+k?) gold and will be debited to the bank account on (?P<world>\w+).")
27+
re.compile(r"The (?:house|guildhall) has a size of (?P<size>\d+) square meters?. "
28+
r"The monthly rent is (?P<rent>\d+k+) gold and will be debited to the bank account on (?P<world>\w+).")
2929
)
3030

31-
rented_regex = re.compile(r"The house has been rented by (?P<owner>[^.]+)\."
31+
rented_regex = re.compile(r"The (?:house|guildhall) has been rented by (?P<owner>[^.]+)\."
3232
r" (?P<pronoun>\w+) has paid the rent until (?P<paid_until>[^.]+)\.")
3333
transfer_regex = re.compile(r"\w+ will move out on (?P<transfer_date>[^(]+)\([^)]+\)(?: and (?P<verb>wants to|will)"
34-
r" pass the house to (?P<transferee>[\w\s]+) for (?P<transfer_price>\d+) gold coin)?")
34+
r" pass the (?:house|guildhall) to (?P<transferee>[\w\s]+) for "
35+
r"(?P<transfer_price>\d+) gold coin)?")
3536
moving_regex = re.compile(r"\w+ will move out on (?P<move_date>[^(]+)")
3637
bid_regex = (
3738
re.compile(r"The highest bid so far is (?P<highest_bid>\d+) gold and has been submitted by (?P<bidder>[^.]+)")

0 commit comments

Comments
 (0)