From e8d39711dd9d67746d384bf6eeb9e55388fd21bb Mon Sep 17 00:00:00 2001 From: Eric Blade Date: Sat, 31 Jul 2010 17:24:06 -0400 Subject: [PATCH] fix from carl for wtsd, more tweaks to everleaf regexes --- pyfpdb/DerivedStats.py | 5 ++++- pyfpdb/EverleafToFpdb.py | 16 ++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/pyfpdb/DerivedStats.py b/pyfpdb/DerivedStats.py index e92bfeaa..7778c956 100644 --- a/pyfpdb/DerivedStats.py +++ b/pyfpdb/DerivedStats.py @@ -290,7 +290,10 @@ class DerivedStats(): # print "p_actions:", self.pfba(actions), "p_folds:", self.pfba(actions, l=('folds',)), "alliners:", alliners # pas = set.union(self.pfba(actions) - self.pfba(actions, l=('folds',)), alliners) - p_in = set(x[1] for x in hand.players) + # hand.players includes people that are sitting out on some sites. + # Those that posted an ante should have been deal cards. + p_in = set([x[0] for x in hand.actions['BLINDSANTES']]) + for (i, street) in enumerate(hand.actionStreets): actions = hand.actions[street] p_in = p_in - self.pfba(actions, l=('folds',)) diff --git a/pyfpdb/EverleafToFpdb.py b/pyfpdb/EverleafToFpdb.py index 9da5966f..454f7e79 100755 --- a/pyfpdb/EverleafToFpdb.py +++ b/pyfpdb/EverleafToFpdb.py @@ -37,8 +37,8 @@ class Everleaf(HandHistoryConverter): re_GameInfo = re.compile(ur"^(Blinds )?(?P[$€]?)(?P[.0-9]+)/[$€]?(?P[.0-9]+) (?PNL|PL|) ?(?P(Hold\'em|Omaha|7 Card Stud))", re.MULTILINE) #re.compile(ur"^(Blinds )?(?P\$| €|)(?P[.0-9]+)/(?:\$| €)?(?P[.0-9]+) (?PNL|PL|) ?(?P(Hold\'em|Omaha|7 Card Stud))", re.MULTILINE) re_HandInfo = re.compile(ur".*#(?P[0-9]+)\n.*\n(Blinds )?(?P[$€])?(?P[.0-9]+)/(?:[$€])?(?P[.0-9]+) (?P.*) - (?P\d\d\d\d/\d\d/\d\d - \d\d:\d\d:\d\d)\nTable (?P.+$)", re.MULTILINE) - re_Button = re.compile(ur"^Seat (?P
[0-9]+)\.txt") @@ -50,15 +50,15 @@ class Everleaf(HandHistoryConverter): self.compiledPlayers = players player_re = "(?P" + "|".join(map(re.escape, players)) + ")" logging.debug("player_re: "+ player_re) - self.re_PostSB = re.compile(ur"^%s: posts small blind \[[$€]? (?P[.0-9]+)" % player_re, re.MULTILINE) - self.re_PostBB = re.compile(ur"^%s: posts big blind \[[$€]? (?P[.0-9]+)" % player_re, re.MULTILINE) - self.re_PostBoth = re.compile(ur"^%s: posts both blinds \[[$€]? (?P[.0-9]+)" % player_re, re.MULTILINE) - self.re_Antes = re.compile(ur"^%s: posts ante \[[$€]? (?P[.0-9]+)" % player_re, re.MULTILINE) + self.re_PostSB = re.compile(ur"^%s: posts small blind \[[$€]? (?P[.0-9]+)\s.*\]$" % player_re, re.MULTILINE) + self.re_PostBB = re.compile(ur"^%s: posts big blind \[[$€]? (?P[.0-9]+)\s.*\]$" % player_re, re.MULTILINE) + self.re_PostBoth = re.compile(ur"^%s: posts both blinds \[[$€]? (?P[.0-9]+)\s.*\]$" % player_re, re.MULTILINE) + self.re_Antes = re.compile(ur"^%s: posts ante \[[$€]? (?P[.0-9]+)\s.*\]$" % player_re, re.MULTILINE) self.re_BringIn = re.compile(ur"^%s posts bring-in [$€]? (?P[.0-9]+)\." % player_re, re.MULTILINE) - self.re_HeroCards = re.compile(ur"^Dealt to %s \[ (?P.*) \]" % player_re, re.MULTILINE) + self.re_HeroCards = re.compile(ur"^Dealt to %s \[ (?P.*) \]$" % player_re, re.MULTILINE) # ^%s(?P: bets| checks| raises| calls| folds)(\s\[(?:\$| €|) (?P[.,\d]+) (USD|EURO|Chips)\])? self.re_Action = re.compile(ur"^%s(?P: bets| checks| raises| calls| folds)(\s\[(?:[$€]?) (?P[.,\d]+)\s?(USD|EURO|Chips|)\])?" % player_re, re.MULTILINE) - self.re_ShowdownAction = re.compile(ur"^%s shows \[ (?P.*) \]" % player_re, re.MULTILINE) + self.re_ShowdownAction = re.compile(ur"^%s shows \[ (?P.*) \]$" % player_re, re.MULTILINE) self.re_CollectPot = re.compile(ur"^%s wins (?:[$€]?)\s?(?P[.\d]+) (USD|EURO|chips)(.*?\[ (?P.*?) \])?" % player_re, re.MULTILINE) self.re_SitsOut = re.compile(ur"^%s sits out" % player_re, re.MULTILINE)