From 4f4a905609e536c94663e95d68cd04e060a8c5bf Mon Sep 17 00:00:00 2001 From: Worros Date: Thu, 7 Apr 2011 17:54:47 +1000 Subject: [PATCH 1/2] FTP: Fix issue with RIT hands. RIT hands on FTP have two summary sections. If a player is sitting out and needs to be removed from the player list, they were removed twice. The second remove from a python dict is a crash. Patch avoids this situation --- pyfpdb/FulltiltToFpdb.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pyfpdb/FulltiltToFpdb.py b/pyfpdb/FulltiltToFpdb.py index 328ae4fa..7c51c5d5 100755 --- a/pyfpdb/FulltiltToFpdb.py +++ b/pyfpdb/FulltiltToFpdb.py @@ -356,8 +356,9 @@ class Fulltilt(HandHistoryConverter): # 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')) + if b.group('PNAME') in plist: + #print "DEBUG: Deleting '%s' from player dict" %(b.group('PNAME')) + del plist[b.group('PNAME')] # Add remaining players for a in plist: From d4c58fd23f7d8564a8cd9c652750756fda751782 Mon Sep 17 00:00:00 2001 From: Worros Date: Thu, 7 Apr 2011 18:26:55 +1000 Subject: [PATCH 2/2] FTP: Fix crasher with returned antes FTP forces all players at a cash game table to post antes, but if they are in the blinds they can timeout and have the ante returned to them, listing them as sitting out. --- pyfpdb/FulltiltToFpdb.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pyfpdb/FulltiltToFpdb.py b/pyfpdb/FulltiltToFpdb.py index 7c51c5d5..9607f5f2 100755 --- a/pyfpdb/FulltiltToFpdb.py +++ b/pyfpdb/FulltiltToFpdb.py @@ -171,6 +171,7 @@ class Fulltilt(HandHistoryConverter): self.re_PostDead = re.compile(r"^%(PLAYERS)s posts a dead small blind of [%(LS)s]?(?P[%(NUM)s]+)" % self.substitutions, re.MULTILINE) self.re_PostBB = re.compile(r"^%(PLAYERS)s posts (the big blind of )?[%(LS)s]?(?P[%(NUM)s]+)" % self.substitutions, re.MULTILINE) self.re_Antes = re.compile(r"^%(PLAYERS)s antes [%(LS)s]?(?P[%(NUM)s]+)" % self.substitutions, re.MULTILINE) + self.re_ReturnsAnte = re.compile(r"^Ante of [%(LS)s]?[%(NUM)s]+ returned to %(PLAYERS)s" % self.substitutions, re.MULTILINE) self.re_BringIn = re.compile(r"^%(PLAYERS)s brings in for [%(LS)s]?(?P[%(NUM)s]+)" % self.substitutions, re.MULTILINE) self.re_PostBoth = re.compile(r"^%(PLAYERS)s posts small \& big blinds \[[%(LS)s]? (?P[%(NUM)s]+)" % self.substitutions, re.MULTILINE) self.re_HeroCards = re.compile(r"^Dealt to %s(?: \[(?P.+?)\])?( \[(?P.+?)\])" % player_re, re.MULTILINE) @@ -415,11 +416,16 @@ class Fulltilt(HandHistoryConverter): def readAntes(self, hand): logging.debug(_("reading antes")) + slist = [] + n = self.re_ReturnsAnte.finditer(hand.handText) + for player in n: + #If a player has their ante returned, then they timed out and are actually sitting out + slist.append(player.group('PNAME')) m = self.re_Antes.finditer(hand.handText) for player in m: logging.debug("hand.addAnte(%s,%s)" %(player.group('PNAME'), player.group('ANTE'))) -# if player.group() != - hand.addAnte(player.group('PNAME'), player.group('ANTE')) + if player.group('PNAME') not in slist: + hand.addAnte(player.group('PNAME'), player.group('ANTE')) def readBringIn(self, hand): m = self.re_BringIn.search(hand.handText,re.DOTALL)