FTP: Refine how players are counted as playing.
Players can be noted as sitting out, but act within the hand. The summary info contains more accurate information, so use that to cull the list.
This commit is contained in:
parent
be83ab0713
commit
bd5d848934
|
@ -76,8 +76,8 @@ class Fulltilt(HandHistoryConverter):
|
||||||
(\s\((?P<TURBO>Turbo)\))?)|(?P<UNREADABLE_INFO>.+))
|
(\s\((?P<TURBO>Turbo)\))?)|(?P<UNREADABLE_INFO>.+))
|
||||||
''' % substitutions, re.VERBOSE)
|
''' % substitutions, re.VERBOSE)
|
||||||
re_Button = re.compile('^The button is in seat #(?P<BUTTON>\d+)', re.MULTILINE)
|
re_Button = re.compile('^The button is in seat #(?P<BUTTON>\d+)', re.MULTILINE)
|
||||||
re_PlayerInfo = re.compile('Seat (?P<SEAT>[0-9]+): (?P<PNAME>.{2,15}) \([%(LS)s](?P<CASH>[,.0-9]+)\)$' % substitutions, re.MULTILINE)
|
re_PlayerInfo = re.compile('Seat (?P<SEAT>[0-9]+): (?P<PNAME>.{2,15}) \([%(LS)s]?(?P<CASH>[%(NUM)s]+)\)(?P<SITOUT>, is sitting out)?$' % substitutions, re.MULTILINE)
|
||||||
re_TourneysPlayerInfo = re.compile('Seat (?P<SEAT>[0-9]+): (?P<PNAME>.{2,15}) \([%(LS)s]?(?P<CASH>[,.0-9]+)\)(, is sitting out)?$' % substitutions, re.MULTILINE)
|
re_SummarySitout = re.compile('Seat (?P<SEAT>[0-9]+): (?P<PNAME>.{2,15}) is sitting out?$' % substitutions, re.MULTILINE)
|
||||||
re_Board = re.compile(r"\[(?P<CARDS>.+)\]")
|
re_Board = re.compile(r"\[(?P<CARDS>.+)\]")
|
||||||
|
|
||||||
#static regex for tourney purpose
|
#static regex for tourney purpose
|
||||||
|
@ -298,13 +298,24 @@ class Fulltilt(HandHistoryConverter):
|
||||||
# Split hand text for FTP, as the regex matches the player names incorrectly
|
# Split hand text for FTP, as the regex matches the player names incorrectly
|
||||||
# in the summary section
|
# in the summary section
|
||||||
pre, post = hand.handText.split('SUMMARY')
|
pre, post = hand.handText.split('SUMMARY')
|
||||||
if hand.gametype['type'] == "ring" :
|
|
||||||
m = self.re_PlayerInfo.finditer(pre)
|
m = self.re_PlayerInfo.finditer(pre)
|
||||||
else: #if hand.gametype['type'] == "tour"
|
plist = {}
|
||||||
m = self.re_TourneysPlayerInfo.finditer(pre)
|
|
||||||
|
|
||||||
|
# Get list of players in header.
|
||||||
for a in m:
|
for a in m:
|
||||||
hand.addPlayer(int(a.group('SEAT')), a.group('PNAME'), a.group('CASH'))
|
plist[a.group('PNAME')] = [int(a.group('SEAT')), a.group('CASH')]
|
||||||
|
|
||||||
|
if hand.gametype['type'] == "ring" :
|
||||||
|
# Remove any listed as sitting out in the summary as start of hand info unreliable
|
||||||
|
n = self.re_SummarySitout.finditer(post)
|
||||||
|
for b in n:
|
||||||
|
del plist[b.group('PNAME')]
|
||||||
|
print "DEBUG: Deleting '%s' from player dict" %(b.group('PNAME'))
|
||||||
|
|
||||||
|
# Add remaining players
|
||||||
|
for a in plist:
|
||||||
|
seat, stack = plist[a]
|
||||||
|
hand.addPlayer(seat, a, stack)
|
||||||
|
|
||||||
|
|
||||||
def markStreets(self, hand):
|
def markStreets(self, hand):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user