From 77591788e41b3806b3af9381c2dc8d8fb3e5fe58 Mon Sep 17 00:00:00 2001 From: Worros Date: Fri, 20 Feb 2009 16:38:13 +0900 Subject: [PATCH 1/3] Minor regex update for raises in Everleaf --- pyfpdb/EverleafToFpdb.py | 2 +- pyfpdb/Hand.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pyfpdb/EverleafToFpdb.py b/pyfpdb/EverleafToFpdb.py index 6d409bda..263ea9d5 100755 --- a/pyfpdb/EverleafToFpdb.py +++ b/pyfpdb/EverleafToFpdb.py @@ -78,7 +78,7 @@ class Everleaf(HandHistoryConverter): self.rexx.setPostBbRegex('.*\n(?P.*): posts big blind \[\$? (?P[.0-9]+)') self.rexx.setPostBothRegex('.*\n(?P.*): posts small \& big blinds \[\$? (?P[.0-9]+)') self.rexx.setHeroCardsRegex('.*\nDealt\sto\s(?P.*)\s\[ (?P.*) \]') - self.rexx.setActionStepRegex('.*\n(?P.*)(?P: bets| checks| raises| calls| folds)(\s\[\$ (?P[.\d]+) (USD|EUR)\])?') + self.rexx.setActionStepRegex('.*\n(?P.*)(?P: bets| checks|: raises| calls| folds)(\s\[\$ (?P[.\d]+) (USD|EUR)\])?') self.rexx.setShowdownActionRegex('.*\n(?P.*) shows \[ (?P.*) \]') self.rexx.setCollectPotRegex('.*\n(?P.*) wins \$ (?P[.\d]+) (USD|EUR)(.*?\[ (?P.*?) \])?') #self.rexx.setCollectPotRegex('.*\n(?P.*) wins \$ (?P[.\d]+) USD(.*\[ (?P) \S\S, \S\S, \S\S, \S\S, \S\S \])?') diff --git a/pyfpdb/Hand.py b/pyfpdb/Hand.py index 7cadbf3d..aede8974 100644 --- a/pyfpdb/Hand.py +++ b/pyfpdb/Hand.py @@ -158,6 +158,7 @@ Card ranks will be uppercased def checkPlayerExists(self,player): + print "XXXX player: ", player if player not in [p[1] for p in self.players]: raise FpdbParseError From 65821dbd2b01cfb1c11b123d617f8dccc9e4c1d2 Mon Sep 17 00:00:00 2001 From: Worros Date: Fri, 20 Feb 2009 16:42:57 +0900 Subject: [PATCH 2/3] Remove debug line that slipped thorugh in last commit --- pyfpdb/Hand.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pyfpdb/Hand.py b/pyfpdb/Hand.py index aede8974..7cadbf3d 100644 --- a/pyfpdb/Hand.py +++ b/pyfpdb/Hand.py @@ -158,7 +158,6 @@ Card ranks will be uppercased def checkPlayerExists(self,player): - print "XXXX player: ", player if player not in [p[1] for p in self.players]: raise FpdbParseError From 81c92f959948e44d6b62ea1b1bbb403dfe4ade8a Mon Sep 17 00:00:00 2001 From: Worros Date: Fri, 20 Feb 2009 17:22:58 +0900 Subject: [PATCH 3/3] Revert last change and try alternate Assumes that the player names cannot have a ':' or a ' ' in them --- pyfpdb/EverleafToFpdb.py | 2 +- pyfpdb/Hand.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pyfpdb/EverleafToFpdb.py b/pyfpdb/EverleafToFpdb.py index 263ea9d5..7a5344c2 100755 --- a/pyfpdb/EverleafToFpdb.py +++ b/pyfpdb/EverleafToFpdb.py @@ -78,7 +78,7 @@ class Everleaf(HandHistoryConverter): self.rexx.setPostBbRegex('.*\n(?P.*): posts big blind \[\$? (?P[.0-9]+)') self.rexx.setPostBothRegex('.*\n(?P.*): posts small \& big blinds \[\$? (?P[.0-9]+)') self.rexx.setHeroCardsRegex('.*\nDealt\sto\s(?P.*)\s\[ (?P.*) \]') - self.rexx.setActionStepRegex('.*\n(?P.*)(?P: bets| checks|: raises| calls| folds)(\s\[\$ (?P[.\d]+) (USD|EUR)\])?') + self.rexx.setActionStepRegex('.*\n(?P[^: ]*)(?P: bets| checks| raises| calls| folds)(\s\[\$ (?P[.\d]+) (USD|EUR)\])?') self.rexx.setShowdownActionRegex('.*\n(?P.*) shows \[ (?P.*) \]') self.rexx.setCollectPotRegex('.*\n(?P.*) wins \$ (?P[.\d]+) (USD|EUR)(.*?\[ (?P.*?) \])?') #self.rexx.setCollectPotRegex('.*\n(?P.*) wins \$ (?P[.\d]+) USD(.*\[ (?P) \S\S, \S\S, \S\S, \S\S, \S\S \])?') diff --git a/pyfpdb/Hand.py b/pyfpdb/Hand.py index 7cadbf3d..ec03fc27 100644 --- a/pyfpdb/Hand.py +++ b/pyfpdb/Hand.py @@ -544,11 +544,11 @@ class Pot(object): #print "returning %f to %s" % (lastbet, returnto) self.total -= lastbet self.committed[returnto] -= lastbet - - + + # Work out side pots commitsall = sorted([(v,k) for (k,v) in self.committed.items() if v >0]) - + self.pots = [] while len(commitsall) > 0: commitslive = [(v,k) for (v,k) in commitsall if k in self.contenders]