From d4400b9f48acc83b231229ee976af95256cef617 Mon Sep 17 00:00:00 2001 From: Worros Date: Thu, 2 Sep 2010 00:40:36 +0800 Subject: [PATCH 01/33] Stars: add part support for NL Single Draw --- pyfpdb/PokerStarsToFpdb.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/pyfpdb/PokerStarsToFpdb.py b/pyfpdb/PokerStarsToFpdb.py index 4fbe9dfd..98abcaf0 100644 --- a/pyfpdb/PokerStarsToFpdb.py +++ b/pyfpdb/PokerStarsToFpdb.py @@ -83,6 +83,7 @@ class PokerStars(HandHistoryConverter): '7 Card Stud Hi/Lo' : ('stud','studhilo'), 'Badugi' : ('draw','badugi'), 'Triple Draw 2-7 Lowball' : ('draw','27_3draw'), + 'Single Draw 2-7 Lowball' : ('draw','27_1draw'), '5 Card Draw' : ('draw','fivedraw') } currencies = { u'€':'EUR', '$':'USD', '':'T$' } @@ -96,7 +97,7 @@ class PokerStars(HandHistoryConverter): (?P(?P[%(LS)s\d\.]+)?\+?(?P[%(LS)s\d\.]+)?\+?(?P[%(LS)s\d\.]+)?\s?(?P%(LEGAL_ISO)s)?|Freeroll)\s+)? # close paren of tournament info (?PHORSE|8\-Game|HOSE|Mixed PLH/PLO)?\s?\(? - (?PHold\'em|Razz|RAZZ|7\sCard\sStud|7\sCard\sStud\sHi/Lo|Omaha|Omaha\sHi/Lo|Badugi|Triple\sDraw\s2\-7\sLowball|5\sCard\sDraw)\s + (?PHold\'em|Razz|RAZZ|7\sCard\sStud|7\sCard\sStud\sHi/Lo|Omaha|Omaha\sHi/Lo|Badugi|Triple\sDraw\s2\-7\sLowball|Single\sDraw\s2\-7\sLowball|5\sCard\sDraw)\s (?PNo\sLimit|Limit|LIMIT|Pot\sLimit)\)?,?\s (-\s)? (Match.*)? #TODO: waiting for reply from user as to what this means @@ -169,6 +170,7 @@ class PokerStars(HandHistoryConverter): ["ring", "stud", "fl"], ["ring", "draw", "fl"], + ["ring", "draw", "nl"], ["tour", "hold", "nl"], ["tour", "hold", "pl"], @@ -178,10 +180,6 @@ class PokerStars(HandHistoryConverter): ] def determineGameType(self, handText): -# inspect the handText and return the gametype dict -# gametype dict is: -# {'limitType': xxx, 'base': xxx, 'category': xxx} - info = {} m = self.re_GameInfo.search(handText) if not m: @@ -191,10 +189,6 @@ class PokerStars(HandHistoryConverter): raise FpdbParseError(_("Unable to recognise gametype from: '%s'") % tmp) mg = m.groupdict() -# I don't think this is doing what we think. mg will always have all -# the expected keys, but the ones that didn't match in the regex will -# have a value of None. It is OK if it throws an exception when it -# runs across an unknown game or limit or whatever. if 'LIMIT' in mg: info['limitType'] = self.limits[mg['LIMIT']] if 'GAME' in mg: From 25cbc0da3071416e4e74f29da6930325f5d0f521 Mon Sep 17 00:00:00 2001 From: sqlcoder Date: Wed, 1 Sep 2010 21:08:13 +0100 Subject: [PATCH 02/33] add logging --- pyfpdb/GuiAutoImport.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pyfpdb/GuiAutoImport.py b/pyfpdb/GuiAutoImport.py index c386f475..23d96c58 100755 --- a/pyfpdb/GuiAutoImport.py +++ b/pyfpdb/GuiAutoImport.py @@ -26,6 +26,12 @@ import gobject import os import sys import time + +import logging +# logging has been set up in fpdb.py or HUD_main.py, use their settings: +log = logging.getLogger("importer") + + import fpdb_import from optparse import OptionParser import Configuration @@ -296,6 +302,7 @@ class GuiAutoImport (threading.Thread): def addSites(self, vbox1, vbox2): the_sites = self.config.get_supported_sites() + #log.debug("addSites: the_sites="+str(the_sites)) for site in the_sites: pathHBox1 = gtk.HBox(False, 0) vbox1.pack_start(pathHBox1, False, True, 0) @@ -306,6 +313,7 @@ class GuiAutoImport (threading.Thread): paths = self.config.get_default_paths(site) self.createSiteLine(pathHBox1, pathHBox2, site, False, paths['hud-defaultPath'], params['converter'], params['enabled']) self.input_settings[site] = [paths['hud-defaultPath']] + [params['converter']] + #log.debug("addSites: input_settings="+str(self.input_settings)) if __name__== "__main__": def destroy(*args): # call back for terminating the main eventloop From e02f2e61ef51d5d24e541096959b3f3950304353 Mon Sep 17 00:00:00 2001 From: sqlcoder Date: Wed, 1 Sep 2010 21:20:22 +0100 Subject: [PATCH 03/33] make sure new variables are set --- pyfpdb/Configuration.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pyfpdb/Configuration.py b/pyfpdb/Configuration.py index 5701b11f..91a16cca 100755 --- a/pyfpdb/Configuration.py +++ b/pyfpdb/Configuration.py @@ -680,6 +680,7 @@ class Config: sys.stderr.write(_("Configuration file %s not found. Using defaults.") % (file)) file = None + self.example_copy,example_file = True,None if file is None: (file,self.example_copy,example_file) = get_config("HUD_config.xml", True) self.file = file From 64cbfb4e4b49eefcc49b498c2c3418dc36aa9a98 Mon Sep 17 00:00:00 2001 From: Worros Date: Thu, 2 Sep 2010 09:12:12 +0800 Subject: [PATCH 04/33] Regression: New test file --- ...1-0.02-20100829.No.VPIP.from.posted.bb.txt | 64 ++ ....02-20100829.No.VPIP.from.posted.bb.txt.hp | 846 ++++++++++++++++++ 2 files changed, 910 insertions(+) create mode 100644 pyfpdb/regression-test-files/cash/Stars/Flop/PLO8-9max-USD-0.01-0.02-20100829.No.VPIP.from.posted.bb.txt create mode 100644 pyfpdb/regression-test-files/cash/Stars/Flop/PLO8-9max-USD-0.01-0.02-20100829.No.VPIP.from.posted.bb.txt.hp diff --git a/pyfpdb/regression-test-files/cash/Stars/Flop/PLO8-9max-USD-0.01-0.02-20100829.No.VPIP.from.posted.bb.txt b/pyfpdb/regression-test-files/cash/Stars/Flop/PLO8-9max-USD-0.01-0.02-20100829.No.VPIP.from.posted.bb.txt new file mode 100644 index 00000000..2b93f9b1 --- /dev/null +++ b/pyfpdb/regression-test-files/cash/Stars/Flop/PLO8-9max-USD-0.01-0.02-20100829.No.VPIP.from.posted.bb.txt @@ -0,0 +1,64 @@ +PokerStars Game #48850962136: Omaha Hi/Lo Pot Limit ($0.01/$0.02 USD) - 2010/08/29 13:22:48 PT [2010/08/29 16:22:48 ET] +Table 'Jiangxi IV' 9-max Seat #6 is the button +Seat 1: 2TONTOM ($0.94 in chips) +Seat 2: RadRandyF ($2.48 in chips) +Seat 3: 1meandog4u ($5 in chips) +Seat 4: Mr NoNo! Srb ($5.31 in chips) +Seat 5: toxic7 ($4.84 in chips) +Seat 6: jthegreat ($5.57 in chips) +Seat 7: CoinJock ($2.80 in chips) +Seat 8: ros-r-reed ($1.52 in chips) +Seat 9: skinner1947 ($1.82 in chips) +CoinJock: posts small blind $0.01 +ros-r-reed: posts big blind $0.02 +1meandog4u: posts big blind $0.02 +*** HOLE CARDS *** +Dealt to 1meandog4u [Qs Th 3c 3h] +skinner1947: folds +2TONTOM: folds +RadRandyF: calls $0.02 +1meandog4u: checks +Mr NoNo! Srb: calls $0.02 +toxic7: calls $0.02 +jthegreat: calls $0.02 +CoinJock: calls $0.01 +ros-r-reed: checks +*** FLOP *** [4d 9c Ts] +CoinJock: checks +ros-r-reed: checks +RadRandyF: checks +1meandog4u: checks +Mr NoNo! Srb: checks +toxic7: checks +jthegreat: checks +*** TURN *** [4d 9c Ts] [Kd] +CoinJock: checks +ros-r-reed: checks +RadRandyF: checks +1meandog4u: checks +Mr NoNo! Srb: checks +toxic7: bets $0.14 +jthegreat: folds +CoinJock: folds +ros-r-reed: folds +RadRandyF: folds +1meandog4u: folds +Mr NoNo! Srb: folds +Uncalled bet ($0.14) returned to toxic7 +toxic7 collected $0.14 from pot +toxic7: doesn't show hand +*** SUMMARY *** +Total pot $0.14 | Rake $0 +Board [4d 9c Ts Kd] +Seat 1: 2TONTOM folded before Flop (didn't bet) +Seat 2: RadRandyF folded on the Turn +Seat 3: 1meandog4u folded on the Turn +Seat 4: Mr NoNo! Srb folded on the Turn +Seat 5: toxic7 collected ($0.14) +Seat 6: jthegreat (button) folded on the Turn +Seat 7: CoinJock (small blind) folded on the Turn +Seat 8: ros-r-reed (big blind) folded on the Turn +Seat 9: skinner1947 folded before Flop (didn't bet) + + + diff --git a/pyfpdb/regression-test-files/cash/Stars/Flop/PLO8-9max-USD-0.01-0.02-20100829.No.VPIP.from.posted.bb.txt.hp b/pyfpdb/regression-test-files/cash/Stars/Flop/PLO8-9max-USD-0.01-0.02-20100829.No.VPIP.from.posted.bb.txt.hp new file mode 100644 index 00000000..ee7f1afd --- /dev/null +++ b/pyfpdb/regression-test-files/cash/Stars/Flop/PLO8-9max-USD-0.01-0.02-20100829.No.VPIP.from.posted.bb.txt.hp @@ -0,0 +1,846 @@ +{ u'1meandog4u': { 'card1': 50, + 'card2': 9, + 'card3': 28, + 'card4': 2, + 'card5': 0, + 'card6': 0, + 'card7': 0, + 'foldBbToStealChance': False, + 'foldSbToStealChance': False, + 'foldToOtherRaisedStreet0': False, + 'foldToOtherRaisedStreet1': False, + 'foldToOtherRaisedStreet2': True, + 'foldToOtherRaisedStreet3': False, + 'foldToOtherRaisedStreet4': False, + 'foldToStreet1CBChance': False, + 'foldToStreet1CBDone': False, + 'foldToStreet2CBChance': False, + 'foldToStreet2CBDone': False, + 'foldToStreet3CBChance': False, + 'foldToStreet3CBDone': False, + 'foldToStreet4CBChance': False, + 'foldToStreet4CBDone': False, + 'foldedBbToSteal': False, + 'foldedSbToSteal': False, + 'other3BStreet0': False, + 'other4BStreet0': False, + 'otherRaisedStreet0': False, + 'otherRaisedStreet1': False, + 'otherRaisedStreet2': True, + 'otherRaisedStreet3': False, + 'otherRaisedStreet4': False, + 'position': 3, + 'raiseFirstInChance': False, + 'raisedFirstIn': False, + 'rake': 0, + 'sawShowdown': False, + 'seatNo': 3, + 'sitout': False, + 'startCards': 0, + 'startCash': 500, + 'street0Aggr': False, + 'street0Bets': 0, + 'street0Calls': 0, + 'street0Raises': 0, + 'street0VPI': False, + 'street0_3BChance': False, + 'street0_3BDone': False, + 'street0_4BChance': False, + 'street0_4BDone': False, + 'street1Aggr': False, + 'street1Bets': 0, + 'street1CBChance': False, + 'street1CBDone': False, + 'street1Calls': 0, + 'street1CheckCallRaiseChance': False, + 'street1CheckCallRaiseDone': False, + 'street1Raises': 0, + 'street1Seen': True, + 'street2Aggr': False, + 'street2Bets': 0, + 'street2CBChance': False, + 'street2CBDone': False, + 'street2Calls': 0, + 'street2CheckCallRaiseChance': False, + 'street2CheckCallRaiseDone': False, + 'street2Raises': 0, + 'street2Seen': True, + 'street3Aggr': False, + 'street3Bets': 0, + 'street3CBChance': False, + 'street3CBDone': False, + 'street3Calls': 0, + 'street3CheckCallRaiseChance': True, + 'street3CheckCallRaiseDone': False, + 'street3Raises': 0, + 'street3Seen': False, + 'street4Aggr': False, + 'street4Bets': 0, + 'street4CBChance': False, + 'street4CBDone': False, + 'street4Calls': 0, + 'street4CheckCallRaiseChance': False, + 'street4CheckCallRaiseDone': False, + 'street4Raises': 0, + 'street4Seen': False, + 'totalProfit': -2, + 'tourneyTypeId': None, + 'tourneysPlayersIds': None, + 'winnings': 0, + 'wonAtSD': 0.0, + 'wonWhenSeenStreet1': 0.0, + 'wonWhenSeenStreet2': 0.0, + 'wonWhenSeenStreet3': 0.0, + 'wonWhenSeenStreet4': 0.0}, + u'2TONTOM': { 'card1': 0, + 'card2': 0, + 'card3': 0, + 'card4': 0, + 'card5': 0, + 'card6': 0, + 'card7': 0, + 'foldBbToStealChance': False, + 'foldSbToStealChance': False, + 'foldToOtherRaisedStreet0': False, + 'foldToOtherRaisedStreet1': False, + 'foldToOtherRaisedStreet2': False, + 'foldToOtherRaisedStreet3': False, + 'foldToOtherRaisedStreet4': False, + 'foldToStreet1CBChance': False, + 'foldToStreet1CBDone': False, + 'foldToStreet2CBChance': False, + 'foldToStreet2CBDone': False, + 'foldToStreet3CBChance': False, + 'foldToStreet3CBDone': False, + 'foldToStreet4CBChance': False, + 'foldToStreet4CBDone': False, + 'foldedBbToSteal': False, + 'foldedSbToSteal': False, + 'other3BStreet0': False, + 'other4BStreet0': False, + 'otherRaisedStreet0': False, + 'otherRaisedStreet1': False, + 'otherRaisedStreet2': False, + 'otherRaisedStreet3': False, + 'otherRaisedStreet4': False, + 'position': 5, + 'raiseFirstInChance': True, + 'raisedFirstIn': False, + 'rake': 0, + 'sawShowdown': False, + 'seatNo': 1, + 'sitout': False, + 'startCards': 0, + 'startCash': 94, + 'street0Aggr': False, + 'street0Bets': 0, + 'street0Calls': 0, + 'street0Raises': 0, + 'street0VPI': False, + 'street0_3BChance': False, + 'street0_3BDone': False, + 'street0_4BChance': False, + 'street0_4BDone': False, + 'street1Aggr': False, + 'street1Bets': 0, + 'street1CBChance': False, + 'street1CBDone': False, + 'street1Calls': 0, + 'street1CheckCallRaiseChance': False, + 'street1CheckCallRaiseDone': False, + 'street1Raises': 0, + 'street1Seen': False, + 'street2Aggr': False, + 'street2Bets': 0, + 'street2CBChance': False, + 'street2CBDone': False, + 'street2Calls': 0, + 'street2CheckCallRaiseChance': False, + 'street2CheckCallRaiseDone': False, + 'street2Raises': 0, + 'street2Seen': False, + 'street3Aggr': False, + 'street3Bets': 0, + 'street3CBChance': False, + 'street3CBDone': False, + 'street3Calls': 0, + 'street3CheckCallRaiseChance': False, + 'street3CheckCallRaiseDone': False, + 'street3Raises': 0, + 'street3Seen': False, + 'street4Aggr': False, + 'street4Bets': 0, + 'street4CBChance': False, + 'street4CBDone': False, + 'street4Calls': 0, + 'street4CheckCallRaiseChance': False, + 'street4CheckCallRaiseDone': False, + 'street4Raises': 0, + 'street4Seen': False, + 'totalProfit': 0, + 'tourneyTypeId': None, + 'tourneysPlayersIds': None, + 'winnings': 0, + 'wonAtSD': 0.0, + 'wonWhenSeenStreet1': 0.0, + 'wonWhenSeenStreet2': 0.0, + 'wonWhenSeenStreet3': 0.0, + 'wonWhenSeenStreet4': 0.0}, + u'CoinJock': { 'card1': 0, + 'card2': 0, + 'card3': 0, + 'card4': 0, + 'card5': 0, + 'card6': 0, + 'card7': 0, + 'foldBbToStealChance': False, + 'foldSbToStealChance': False, + 'foldToOtherRaisedStreet0': False, + 'foldToOtherRaisedStreet1': False, + 'foldToOtherRaisedStreet2': True, + 'foldToOtherRaisedStreet3': False, + 'foldToOtherRaisedStreet4': False, + 'foldToStreet1CBChance': False, + 'foldToStreet1CBDone': False, + 'foldToStreet2CBChance': False, + 'foldToStreet2CBDone': False, + 'foldToStreet3CBChance': False, + 'foldToStreet3CBDone': False, + 'foldToStreet4CBChance': False, + 'foldToStreet4CBDone': False, + 'foldedBbToSteal': False, + 'foldedSbToSteal': False, + 'other3BStreet0': False, + 'other4BStreet0': False, + 'otherRaisedStreet0': False, + 'otherRaisedStreet1': False, + 'otherRaisedStreet2': True, + 'otherRaisedStreet3': False, + 'otherRaisedStreet4': False, + 'position': 'S', + 'raiseFirstInChance': False, + 'raisedFirstIn': False, + 'rake': 0, + 'sawShowdown': False, + 'seatNo': 7, + 'sitout': False, + 'startCards': 0, + 'startCash': 280, + 'street0Aggr': False, + 'street0Bets': 0, + 'street0Calls': 1, + 'street0Raises': 0, + 'street0VPI': True, + 'street0_3BChance': False, + 'street0_3BDone': False, + 'street0_4BChance': False, + 'street0_4BDone': False, + 'street1Aggr': False, + 'street1Bets': 0, + 'street1CBChance': False, + 'street1CBDone': False, + 'street1Calls': 0, + 'street1CheckCallRaiseChance': False, + 'street1CheckCallRaiseDone': False, + 'street1Raises': 0, + 'street1Seen': True, + 'street2Aggr': False, + 'street2Bets': 0, + 'street2CBChance': False, + 'street2CBDone': False, + 'street2Calls': 0, + 'street2CheckCallRaiseChance': False, + 'street2CheckCallRaiseDone': False, + 'street2Raises': 0, + 'street2Seen': True, + 'street3Aggr': False, + 'street3Bets': 0, + 'street3CBChance': False, + 'street3CBDone': False, + 'street3Calls': 0, + 'street3CheckCallRaiseChance': True, + 'street3CheckCallRaiseDone': False, + 'street3Raises': 0, + 'street3Seen': False, + 'street4Aggr': False, + 'street4Bets': 0, + 'street4CBChance': False, + 'street4CBDone': False, + 'street4Calls': 0, + 'street4CheckCallRaiseChance': False, + 'street4CheckCallRaiseDone': False, + 'street4Raises': 0, + 'street4Seen': False, + 'totalProfit': -2, + 'tourneyTypeId': None, + 'tourneysPlayersIds': None, + 'winnings': 0, + 'wonAtSD': 0.0, + 'wonWhenSeenStreet1': 0.0, + 'wonWhenSeenStreet2': 0.0, + 'wonWhenSeenStreet3': 0.0, + 'wonWhenSeenStreet4': 0.0}, + u'Mr NoNo! Srb': { 'card1': 0, + 'card2': 0, + 'card3': 0, + 'card4': 0, + 'card5': 0, + 'card6': 0, + 'card7': 0, + 'foldBbToStealChance': False, + 'foldSbToStealChance': False, + 'foldToOtherRaisedStreet0': False, + 'foldToOtherRaisedStreet1': False, + 'foldToOtherRaisedStreet2': True, + 'foldToOtherRaisedStreet3': False, + 'foldToOtherRaisedStreet4': False, + 'foldToStreet1CBChance': False, + 'foldToStreet1CBDone': False, + 'foldToStreet2CBChance': False, + 'foldToStreet2CBDone': False, + 'foldToStreet3CBChance': False, + 'foldToStreet3CBDone': False, + 'foldToStreet4CBChance': False, + 'foldToStreet4CBDone': False, + 'foldedBbToSteal': False, + 'foldedSbToSteal': False, + 'other3BStreet0': False, + 'other4BStreet0': False, + 'otherRaisedStreet0': False, + 'otherRaisedStreet1': False, + 'otherRaisedStreet2': True, + 'otherRaisedStreet3': False, + 'otherRaisedStreet4': False, + 'position': 2, + 'raiseFirstInChance': False, + 'raisedFirstIn': False, + 'rake': 0, + 'sawShowdown': False, + 'seatNo': 4, + 'sitout': False, + 'startCards': 0, + 'startCash': 531, + 'street0Aggr': False, + 'street0Bets': 0, + 'street0Calls': 1, + 'street0Raises': 0, + 'street0VPI': True, + 'street0_3BChance': False, + 'street0_3BDone': False, + 'street0_4BChance': False, + 'street0_4BDone': False, + 'street1Aggr': False, + 'street1Bets': 0, + 'street1CBChance': False, + 'street1CBDone': False, + 'street1Calls': 0, + 'street1CheckCallRaiseChance': False, + 'street1CheckCallRaiseDone': False, + 'street1Raises': 0, + 'street1Seen': True, + 'street2Aggr': False, + 'street2Bets': 0, + 'street2CBChance': False, + 'street2CBDone': False, + 'street2Calls': 0, + 'street2CheckCallRaiseChance': False, + 'street2CheckCallRaiseDone': False, + 'street2Raises': 0, + 'street2Seen': True, + 'street3Aggr': False, + 'street3Bets': 0, + 'street3CBChance': False, + 'street3CBDone': False, + 'street3Calls': 0, + 'street3CheckCallRaiseChance': True, + 'street3CheckCallRaiseDone': False, + 'street3Raises': 0, + 'street3Seen': False, + 'street4Aggr': False, + 'street4Bets': 0, + 'street4CBChance': False, + 'street4CBDone': False, + 'street4Calls': 0, + 'street4CheckCallRaiseChance': False, + 'street4CheckCallRaiseDone': False, + 'street4Raises': 0, + 'street4Seen': False, + 'totalProfit': -2, + 'tourneyTypeId': None, + 'tourneysPlayersIds': None, + 'winnings': 0, + 'wonAtSD': 0.0, + 'wonWhenSeenStreet1': 0.0, + 'wonWhenSeenStreet2': 0.0, + 'wonWhenSeenStreet3': 0.0, + 'wonWhenSeenStreet4': 0.0}, + u'RadRandyF': { 'card1': 0, + 'card2': 0, + 'card3': 0, + 'card4': 0, + 'card5': 0, + 'card6': 0, + 'card7': 0, + 'foldBbToStealChance': False, + 'foldSbToStealChance': False, + 'foldToOtherRaisedStreet0': False, + 'foldToOtherRaisedStreet1': False, + 'foldToOtherRaisedStreet2': True, + 'foldToOtherRaisedStreet3': False, + 'foldToOtherRaisedStreet4': False, + 'foldToStreet1CBChance': False, + 'foldToStreet1CBDone': False, + 'foldToStreet2CBChance': False, + 'foldToStreet2CBDone': False, + 'foldToStreet3CBChance': False, + 'foldToStreet3CBDone': False, + 'foldToStreet4CBChance': False, + 'foldToStreet4CBDone': False, + 'foldedBbToSteal': False, + 'foldedSbToSteal': False, + 'other3BStreet0': False, + 'other4BStreet0': False, + 'otherRaisedStreet0': False, + 'otherRaisedStreet1': False, + 'otherRaisedStreet2': True, + 'otherRaisedStreet3': False, + 'otherRaisedStreet4': False, + 'position': 4, + 'raiseFirstInChance': True, + 'raisedFirstIn': False, + 'rake': 0, + 'sawShowdown': False, + 'seatNo': 2, + 'sitout': False, + 'startCards': 0, + 'startCash': 248, + 'street0Aggr': False, + 'street0Bets': 0, + 'street0Calls': 1, + 'street0Raises': 0, + 'street0VPI': True, + 'street0_3BChance': False, + 'street0_3BDone': False, + 'street0_4BChance': False, + 'street0_4BDone': False, + 'street1Aggr': False, + 'street1Bets': 0, + 'street1CBChance': False, + 'street1CBDone': False, + 'street1Calls': 0, + 'street1CheckCallRaiseChance': False, + 'street1CheckCallRaiseDone': False, + 'street1Raises': 0, + 'street1Seen': True, + 'street2Aggr': False, + 'street2Bets': 0, + 'street2CBChance': False, + 'street2CBDone': False, + 'street2Calls': 0, + 'street2CheckCallRaiseChance': False, + 'street2CheckCallRaiseDone': False, + 'street2Raises': 0, + 'street2Seen': True, + 'street3Aggr': False, + 'street3Bets': 0, + 'street3CBChance': False, + 'street3CBDone': False, + 'street3Calls': 0, + 'street3CheckCallRaiseChance': True, + 'street3CheckCallRaiseDone': False, + 'street3Raises': 0, + 'street3Seen': False, + 'street4Aggr': False, + 'street4Bets': 0, + 'street4CBChance': False, + 'street4CBDone': False, + 'street4Calls': 0, + 'street4CheckCallRaiseChance': False, + 'street4CheckCallRaiseDone': False, + 'street4Raises': 0, + 'street4Seen': False, + 'totalProfit': -2, + 'tourneyTypeId': None, + 'tourneysPlayersIds': None, + 'winnings': 0, + 'wonAtSD': 0.0, + 'wonWhenSeenStreet1': 0.0, + 'wonWhenSeenStreet2': 0.0, + 'wonWhenSeenStreet3': 0.0, + 'wonWhenSeenStreet4': 0.0}, + u'jthegreat': { 'card1': 0, + 'card2': 0, + 'card3': 0, + 'card4': 0, + 'card5': 0, + 'card6': 0, + 'card7': 0, + 'foldBbToStealChance': False, + 'foldSbToStealChance': False, + 'foldToOtherRaisedStreet0': False, + 'foldToOtherRaisedStreet1': False, + 'foldToOtherRaisedStreet2': True, + 'foldToOtherRaisedStreet3': False, + 'foldToOtherRaisedStreet4': False, + 'foldToStreet1CBChance': False, + 'foldToStreet1CBDone': False, + 'foldToStreet2CBChance': False, + 'foldToStreet2CBDone': False, + 'foldToStreet3CBChance': False, + 'foldToStreet3CBDone': False, + 'foldToStreet4CBChance': False, + 'foldToStreet4CBDone': False, + 'foldedBbToSteal': False, + 'foldedSbToSteal': False, + 'other3BStreet0': False, + 'other4BStreet0': False, + 'otherRaisedStreet0': False, + 'otherRaisedStreet1': False, + 'otherRaisedStreet2': True, + 'otherRaisedStreet3': False, + 'otherRaisedStreet4': False, + 'position': 0, + 'raiseFirstInChance': False, + 'raisedFirstIn': False, + 'rake': 0, + 'sawShowdown': False, + 'seatNo': 6, + 'sitout': False, + 'startCards': 0, + 'startCash': 557, + 'street0Aggr': False, + 'street0Bets': 0, + 'street0Calls': 1, + 'street0Raises': 0, + 'street0VPI': True, + 'street0_3BChance': False, + 'street0_3BDone': False, + 'street0_4BChance': False, + 'street0_4BDone': False, + 'street1Aggr': False, + 'street1Bets': 0, + 'street1CBChance': False, + 'street1CBDone': False, + 'street1Calls': 0, + 'street1CheckCallRaiseChance': False, + 'street1CheckCallRaiseDone': False, + 'street1Raises': 0, + 'street1Seen': True, + 'street2Aggr': False, + 'street2Bets': 0, + 'street2CBChance': False, + 'street2CBDone': False, + 'street2Calls': 0, + 'street2CheckCallRaiseChance': False, + 'street2CheckCallRaiseDone': False, + 'street2Raises': 0, + 'street2Seen': True, + 'street3Aggr': False, + 'street3Bets': 0, + 'street3CBChance': False, + 'street3CBDone': False, + 'street3Calls': 0, + 'street3CheckCallRaiseChance': False, + 'street3CheckCallRaiseDone': False, + 'street3Raises': 0, + 'street3Seen': False, + 'street4Aggr': False, + 'street4Bets': 0, + 'street4CBChance': False, + 'street4CBDone': False, + 'street4Calls': 0, + 'street4CheckCallRaiseChance': False, + 'street4CheckCallRaiseDone': False, + 'street4Raises': 0, + 'street4Seen': False, + 'totalProfit': -2, + 'tourneyTypeId': None, + 'tourneysPlayersIds': None, + 'winnings': 0, + 'wonAtSD': 0.0, + 'wonWhenSeenStreet1': 0.0, + 'wonWhenSeenStreet2': 0.0, + 'wonWhenSeenStreet3': 0.0, + 'wonWhenSeenStreet4': 0.0}, + u'ros-r-reed': { 'card1': 0, + 'card2': 0, + 'card3': 0, + 'card4': 0, + 'card5': 0, + 'card6': 0, + 'card7': 0, + 'foldBbToStealChance': False, + 'foldSbToStealChance': False, + 'foldToOtherRaisedStreet0': False, + 'foldToOtherRaisedStreet1': False, + 'foldToOtherRaisedStreet2': True, + 'foldToOtherRaisedStreet3': False, + 'foldToOtherRaisedStreet4': False, + 'foldToStreet1CBChance': False, + 'foldToStreet1CBDone': False, + 'foldToStreet2CBChance': False, + 'foldToStreet2CBDone': False, + 'foldToStreet3CBChance': False, + 'foldToStreet3CBDone': False, + 'foldToStreet4CBChance': False, + 'foldToStreet4CBDone': False, + 'foldedBbToSteal': False, + 'foldedSbToSteal': False, + 'other3BStreet0': False, + 'other4BStreet0': False, + 'otherRaisedStreet0': False, + 'otherRaisedStreet1': False, + 'otherRaisedStreet2': True, + 'otherRaisedStreet3': False, + 'otherRaisedStreet4': False, + 'position': 'B', + 'raiseFirstInChance': False, + 'raisedFirstIn': False, + 'rake': 0, + 'sawShowdown': False, + 'seatNo': 8, + 'sitout': False, + 'startCards': 0, + 'startCash': 152, + 'street0Aggr': False, + 'street0Bets': 0, + 'street0Calls': 0, + 'street0Raises': 0, + 'street0VPI': False, + 'street0_3BChance': False, + 'street0_3BDone': False, + 'street0_4BChance': False, + 'street0_4BDone': False, + 'street1Aggr': False, + 'street1Bets': 0, + 'street1CBChance': False, + 'street1CBDone': False, + 'street1Calls': 0, + 'street1CheckCallRaiseChance': False, + 'street1CheckCallRaiseDone': False, + 'street1Raises': 0, + 'street1Seen': True, + 'street2Aggr': False, + 'street2Bets': 0, + 'street2CBChance': False, + 'street2CBDone': False, + 'street2Calls': 0, + 'street2CheckCallRaiseChance': False, + 'street2CheckCallRaiseDone': False, + 'street2Raises': 0, + 'street2Seen': True, + 'street3Aggr': False, + 'street3Bets': 0, + 'street3CBChance': False, + 'street3CBDone': False, + 'street3Calls': 0, + 'street3CheckCallRaiseChance': True, + 'street3CheckCallRaiseDone': False, + 'street3Raises': 0, + 'street3Seen': False, + 'street4Aggr': False, + 'street4Bets': 0, + 'street4CBChance': False, + 'street4CBDone': False, + 'street4Calls': 0, + 'street4CheckCallRaiseChance': False, + 'street4CheckCallRaiseDone': False, + 'street4Raises': 0, + 'street4Seen': False, + 'totalProfit': -2, + 'tourneyTypeId': None, + 'tourneysPlayersIds': None, + 'winnings': 0, + 'wonAtSD': 0.0, + 'wonWhenSeenStreet1': 0.0, + 'wonWhenSeenStreet2': 0.0, + 'wonWhenSeenStreet3': 0.0, + 'wonWhenSeenStreet4': 0.0}, + u'skinner1947': { 'card1': 0, + 'card2': 0, + 'card3': 0, + 'card4': 0, + 'card5': 0, + 'card6': 0, + 'card7': 0, + 'foldBbToStealChance': False, + 'foldSbToStealChance': False, + 'foldToOtherRaisedStreet0': False, + 'foldToOtherRaisedStreet1': False, + 'foldToOtherRaisedStreet2': False, + 'foldToOtherRaisedStreet3': False, + 'foldToOtherRaisedStreet4': False, + 'foldToStreet1CBChance': False, + 'foldToStreet1CBDone': False, + 'foldToStreet2CBChance': False, + 'foldToStreet2CBDone': False, + 'foldToStreet3CBChance': False, + 'foldToStreet3CBDone': False, + 'foldToStreet4CBChance': False, + 'foldToStreet4CBDone': False, + 'foldedBbToSteal': False, + 'foldedSbToSteal': False, + 'other3BStreet0': False, + 'other4BStreet0': False, + 'otherRaisedStreet0': False, + 'otherRaisedStreet1': False, + 'otherRaisedStreet2': False, + 'otherRaisedStreet3': False, + 'otherRaisedStreet4': False, + 'position': 6, + 'raiseFirstInChance': True, + 'raisedFirstIn': False, + 'rake': 0, + 'sawShowdown': False, + 'seatNo': 9, + 'sitout': False, + 'startCards': 0, + 'startCash': 182, + 'street0Aggr': False, + 'street0Bets': 0, + 'street0Calls': 0, + 'street0Raises': 0, + 'street0VPI': False, + 'street0_3BChance': False, + 'street0_3BDone': False, + 'street0_4BChance': False, + 'street0_4BDone': False, + 'street1Aggr': False, + 'street1Bets': 0, + 'street1CBChance': False, + 'street1CBDone': False, + 'street1Calls': 0, + 'street1CheckCallRaiseChance': False, + 'street1CheckCallRaiseDone': False, + 'street1Raises': 0, + 'street1Seen': False, + 'street2Aggr': False, + 'street2Bets': 0, + 'street2CBChance': False, + 'street2CBDone': False, + 'street2Calls': 0, + 'street2CheckCallRaiseChance': False, + 'street2CheckCallRaiseDone': False, + 'street2Raises': 0, + 'street2Seen': False, + 'street3Aggr': False, + 'street3Bets': 0, + 'street3CBChance': False, + 'street3CBDone': False, + 'street3Calls': 0, + 'street3CheckCallRaiseChance': False, + 'street3CheckCallRaiseDone': False, + 'street3Raises': 0, + 'street3Seen': False, + 'street4Aggr': False, + 'street4Bets': 0, + 'street4CBChance': False, + 'street4CBDone': False, + 'street4Calls': 0, + 'street4CheckCallRaiseChance': False, + 'street4CheckCallRaiseDone': False, + 'street4Raises': 0, + 'street4Seen': False, + 'totalProfit': 0, + 'tourneyTypeId': None, + 'tourneysPlayersIds': None, + 'winnings': 0, + 'wonAtSD': 0.0, + 'wonWhenSeenStreet1': 0.0, + 'wonWhenSeenStreet2': 0.0, + 'wonWhenSeenStreet3': 0.0, + 'wonWhenSeenStreet4': 0.0}, + u'toxic7': { 'card1': 0, + 'card2': 0, + 'card3': 0, + 'card4': 0, + 'card5': 0, + 'card6': 0, + 'card7': 0, + 'foldBbToStealChance': False, + 'foldSbToStealChance': False, + 'foldToOtherRaisedStreet0': False, + 'foldToOtherRaisedStreet1': False, + 'foldToOtherRaisedStreet2': False, + 'foldToOtherRaisedStreet3': False, + 'foldToOtherRaisedStreet4': False, + 'foldToStreet1CBChance': False, + 'foldToStreet1CBDone': False, + 'foldToStreet2CBChance': False, + 'foldToStreet2CBDone': False, + 'foldToStreet3CBChance': False, + 'foldToStreet3CBDone': False, + 'foldToStreet4CBChance': False, + 'foldToStreet4CBDone': False, + 'foldedBbToSteal': False, + 'foldedSbToSteal': False, + 'other3BStreet0': False, + 'other4BStreet0': False, + 'otherRaisedStreet0': False, + 'otherRaisedStreet1': False, + 'otherRaisedStreet2': False, + 'otherRaisedStreet3': False, + 'otherRaisedStreet4': False, + 'position': 1, + 'raiseFirstInChance': False, + 'raisedFirstIn': False, + 'rake': 0, + 'sawShowdown': False, + 'seatNo': 5, + 'sitout': False, + 'startCards': 0, + 'startCash': 484, + 'street0Aggr': False, + 'street0Bets': 0, + 'street0Calls': 1, + 'street0Raises': 0, + 'street0VPI': True, + 'street0_3BChance': False, + 'street0_3BDone': False, + 'street0_4BChance': False, + 'street0_4BDone': False, + 'street1Aggr': False, + 'street1Bets': 0, + 'street1CBChance': False, + 'street1CBDone': False, + 'street1Calls': 0, + 'street1CheckCallRaiseChance': False, + 'street1CheckCallRaiseDone': False, + 'street1Raises': 0, + 'street1Seen': True, + 'street2Aggr': True, + 'street2Bets': 1, + 'street2CBChance': False, + 'street2CBDone': False, + 'street2Calls': 0, + 'street2CheckCallRaiseChance': False, + 'street2CheckCallRaiseDone': False, + 'street2Raises': 0, + 'street2Seen': True, + 'street3Aggr': False, + 'street3Bets': 0, + 'street3CBChance': False, + 'street3CBDone': False, + 'street3Calls': 0, + 'street3CheckCallRaiseChance': False, + 'street3CheckCallRaiseDone': False, + 'street3Raises': 0, + 'street3Seen': False, + 'street4Aggr': False, + 'street4Bets': 0, + 'street4CBChance': False, + 'street4CBDone': False, + 'street4Calls': 0, + 'street4CheckCallRaiseChance': False, + 'street4CheckCallRaiseDone': False, + 'street4Raises': 0, + 'street4Seen': False, + 'totalProfit': 12, + 'tourneyTypeId': None, + 'tourneysPlayersIds': None, + 'winnings': 14, + 'wonAtSD': 0.0, + 'wonWhenSeenStreet1': 1.0, + 'wonWhenSeenStreet2': 0.0, + 'wonWhenSeenStreet3': 0.0, + 'wonWhenSeenStreet4': 0.0}} From 72e386738338e25b709ed78006782bc8f3ca897c Mon Sep 17 00:00:00 2001 From: Worros Date: Thu, 2 Sep 2010 13:42:40 +0800 Subject: [PATCH 05/33] THP: Report parse errors properly --- pyfpdb/TestHandsPlayers.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyfpdb/TestHandsPlayers.py b/pyfpdb/TestHandsPlayers.py index 7be168a7..cbb3f811 100755 --- a/pyfpdb/TestHandsPlayers.py +++ b/pyfpdb/TestHandsPlayers.py @@ -62,7 +62,8 @@ def compare(leaf, importer, errors, site): # test if there is a .hp version of the file importer.addBulkImportImportFileOrDir(filename, site=site) (stored, dups, partial, errs, ttime) = importer.runImport() - if os.path.isfile(filename + '.hp'): + + if os.path.isfile(filename + '.hp') and errs < 1: # Compare them hashfilename = filename + '.hp' @@ -90,6 +91,8 @@ def compare(leaf, importer, errors, site): else: # Stats don't match - Doh! errors.error_report(filename, hand, stat, ghash, testhash, p) + if errs > 0: + errors.error_report(filename, False, "Parse", False, False, False) importer.clearFileList() From bd6e22766209750a228f91bdc78e42019d531ffb Mon Sep 17 00:00:00 2001 From: Worros Date: Thu, 2 Sep 2010 13:52:18 +0800 Subject: [PATCH 06/33] Test Config: Add OnGame to parser list --- pyfpdb/HUD_config.test.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyfpdb/HUD_config.test.xml b/pyfpdb/HUD_config.test.xml index a70d2b67..38d808c0 100644 --- a/pyfpdb/HUD_config.test.xml +++ b/pyfpdb/HUD_config.test.xml @@ -573,6 +573,7 @@ Left-Drag to Move" + From 376894bba3d9d7023a5228b4d9ec5f07b46e6fd1 Mon Sep 17 00:00:00 2001 From: Worros Date: Thu, 2 Sep 2010 13:52:54 +0800 Subject: [PATCH 07/33] THP: Add remaining directories for test coverage --- pyfpdb/TestHandsPlayers.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pyfpdb/TestHandsPlayers.py b/pyfpdb/TestHandsPlayers.py index cbb3f811..ab924637 100755 --- a/pyfpdb/TestHandsPlayers.py +++ b/pyfpdb/TestHandsPlayers.py @@ -131,11 +131,16 @@ def main(argv=None): FTPErrors = FpdbError('Full Tilt Poker') PartyPokerErrors = FpdbError('Party Poker') BetfairErrors = FpdbError('Betfair') + OnGameErrors = FpdbError('Betfair') walk_testfiles("regression-test-files/cash/Stars/", compare, importer, PokerStarsErrors, "PokerStars") + walk_testfiles("regression-test-files/tour/Stars/", compare, importer, PokerStarsErrors, "PokerStars") walk_testfiles("regression-test-files/cash/FTP/", compare, importer, FTPErrors, "Full Tilt Poker") + walk_testfiles("regression-test-files/tour/FTP/", compare, importer, FTPErrors, "Full Tilt Poker") #walk_testfiles("regression-test-files/cash/PartyPoker/", compare, importer, PartyPokerErrors, "PartyPoker") + walk_testfiles("regression-test-files/tour/PartyPoker/", compare, importer, PartyPokerErrors, "PartyPoker") walk_testfiles("regression-test-files/cash/Betfair/", compare, importer, BetfairErrors, "Betfair") + walk_testfiles("regression-test-files/cash/OnGame/", compare, importer, OnGameErrors, "OnGame") totalerrors = PokerStarsErrors.errorcount + FTPErrors.errorcount + PartyPokerErrors.errorcount + BetfairErrors.errorcount From 304c9e71a26f0264bfd0b588e150bc6bf6461643 Mon Sep 17 00:00:00 2001 From: Worros Date: Thu, 2 Sep 2010 14:02:19 +0800 Subject: [PATCH 08/33] Hand: Wrap Pot.end() section in exception handler If Hand.end() fails in that section, then something is seriously wrong with either action parsing or stack parsing. Throw a parse error in the hopes we can continue on. --- pyfpdb/Hand.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pyfpdb/Hand.py b/pyfpdb/Hand.py index ac8fc1f2..9f9d009d 100644 --- a/pyfpdb/Hand.py +++ b/pyfpdb/Hand.py @@ -1514,11 +1514,15 @@ class Pot(object): 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] - v1 = commitslive[0][0] - self.pots += [sum([min(v,v1) for (v,k) in commitsall])] - commitsall = [((v-v1),k) for (v,k) in commitsall if v-v1 >0] + try: + while len(commitsall) > 0: + commitslive = [(v,k) for (v,k) in commitsall if k in self.contenders] + v1 = commitslive[0][0] + self.pots += [sum([min(v,v1) for (v,k) in commitsall])] + commitsall = [((v-v1),k) for (v,k) in commitsall if v-v1 >0] + except IndexError, e: + log.error(_("Pot.end(): Major failure while calculating pot: '%s'" % e)) + raise FpdbParseError(_("Pot.end(): Major failure while calculating pot: '%s'" % e)) # TODO: I think rake gets taken out of the pots. # so it goes: From 742dec8b158548e3538130d3fe5cb29034e541b1 Mon Sep 17 00:00:00 2001 From: Worros Date: Thu, 2 Sep 2010 14:04:34 +0800 Subject: [PATCH 09/33] THP: Re-enable Party cash parsing --- pyfpdb/TestHandsPlayers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyfpdb/TestHandsPlayers.py b/pyfpdb/TestHandsPlayers.py index ab924637..3c5ecfe6 100755 --- a/pyfpdb/TestHandsPlayers.py +++ b/pyfpdb/TestHandsPlayers.py @@ -137,7 +137,7 @@ def main(argv=None): walk_testfiles("regression-test-files/tour/Stars/", compare, importer, PokerStarsErrors, "PokerStars") walk_testfiles("regression-test-files/cash/FTP/", compare, importer, FTPErrors, "Full Tilt Poker") walk_testfiles("regression-test-files/tour/FTP/", compare, importer, FTPErrors, "Full Tilt Poker") - #walk_testfiles("regression-test-files/cash/PartyPoker/", compare, importer, PartyPokerErrors, "PartyPoker") + walk_testfiles("regression-test-files/cash/PartyPoker/", compare, importer, PartyPokerErrors, "PartyPoker") walk_testfiles("regression-test-files/tour/PartyPoker/", compare, importer, PartyPokerErrors, "PartyPoker") walk_testfiles("regression-test-files/cash/Betfair/", compare, importer, BetfairErrors, "Betfair") walk_testfiles("regression-test-files/cash/OnGame/", compare, importer, OnGameErrors, "OnGame") From cc3197b5d1938b0cef4d7ff70e05c9fccda12009 Mon Sep 17 00:00:00 2001 From: Worros Date: Thu, 2 Sep 2010 15:24:30 +0800 Subject: [PATCH 10/33] Grapher: commit patch to allow showdown lines to be removed But only in source for the moment. Need to add a Filter for the different graph types --- pyfpdb/GuiGraphViewer.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/pyfpdb/GuiGraphViewer.py b/pyfpdb/GuiGraphViewer.py index 09acb483..2b985f41 100644 --- a/pyfpdb/GuiGraphViewer.py +++ b/pyfpdb/GuiGraphViewer.py @@ -153,6 +153,11 @@ class GuiGraphViewer (threading.Thread): siteids = self.filters.getSiteIds() limits = self.filters.getLimits() games = self.filters.getGames() + graphs = { + "profit" : True, + "sawShowdown" : True, + "nonShowdown" : True + } for i in ('show', 'none'): if i in limits: @@ -230,17 +235,14 @@ class GuiGraphViewer (threading.Thread): #print "No hands returned by graph query" else: self.ax.set_title(_("Profit graph for ring games")) - #text = "Profit: $%.2f\nTotal Hands: %d" %(green[-1], len(green)) - #self.ax.annotate(text, - # xy=(10, -10), - # xycoords='axes points', - # horizontalalignment='left', verticalalignment='top', - # fontsize=10) #Draw plot - self.ax.plot(green, color='green', label=_('Hands: %d\nProfit: $%.2f') %(len(green), green[-1])) - self.ax.plot(blue, color='blue', label=_('Showdown: $%.2f') %(blue[-1])) - self.ax.plot(red, color='red', label=_('Non-showdown: $%.2f') %(red[-1])) + if graphs['profit'] == True: + self.ax.plot(green, color='green', label=_('Hands: %d\nProfit: $%.2f') %(len(green), green[-1])) + if graphs['sawShowdown'] == True: + self.ax.plot(blue, color='blue', label=_('Showdown: $%.2f') %(blue[-1])) + if graphs['nonShowdown'] == True: + self.ax.plot(red, color='red', label=_('Non-showdown: $%.2f') %(red[-1])) if sys.version[0:3] == '2.5': self.ax.legend(loc='upper left', shadow=True, prop=FontProperties(size='smaller')) else: From 3f0cdfbaa5687e7cea68e4854ceb6cb723a244a9 Mon Sep 17 00:00:00 2001 From: Worros Date: Fri, 3 Sep 2010 02:29:34 +0800 Subject: [PATCH 11/33] Regression: Add Absolute Stud Hi/Lo hand --- ...USD-0.02-0.04-200903.River.with.mucked.txt | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 pyfpdb/regression-test-files/cash/Absolute/Stud/7-StudHL-USD-0.02-0.04-200903.River.with.mucked.txt diff --git a/pyfpdb/regression-test-files/cash/Absolute/Stud/7-StudHL-USD-0.02-0.04-200903.River.with.mucked.txt b/pyfpdb/regression-test-files/cash/Absolute/Stud/7-StudHL-USD-0.02-0.04-200903.River.with.mucked.txt new file mode 100644 index 00000000..f91ed38c --- /dev/null +++ b/pyfpdb/regression-test-files/cash/Absolute/Stud/7-StudHL-USD-0.02-0.04-200903.River.with.mucked.txt @@ -0,0 +1,91 @@ +Stage #1300000000: Seven Card Hi/Lo Normal $0.02/$0.04 - 2009-03-18 19:10:00 (ET) +Seat 1 - PLAYER1 ($0.17 in chips) +Seat 2 - PLAYER2 ($0.36 in chips) +Seat 3 - PLAYER3 ($3.46 in chips) +Seat 5 - PLAYER4 ($1 in chips) +Seat 6 - PLAYER5 ($1.07 in chips) +Seat 7 - PLAYER6 ($2.31 in chips) +Seat 8 - PLAYER7 ($0.93 in chips) +Player1 - Ante $0.01 +PLAYER5 - Ante $0.01 +PLAYER6 - Ante $0.01 +PLAYER3 - Ante $0.01 +PLAYER7 - Ante $0.01 +PLAYER2 - Ante $0.01 +PLAYER4 - Ante $0.01 +*** 3rd STREET *** +Player1 - Pocket [H H Js] +PLAYER2 - Pocket [H H 7h] +PLAYER3 - Pocket [H H 6s] +PLAYER4 - Pocket [10c 5c 7s] +PLAYER5 - Pocket [H H Qh] +PLAYER6 - Pocket [H H 9c] +PLAYER7 - Pocket [H H 3s] +PLAYER7 - Bring-In $0.01 +Player1 - Calls $0.01 +PLAYER2 - Folds +PLAYER3 - Calls $0.01 +PLAYER4 - Folds +PLAYER5 - Folds +PLAYER6 - Calls $0.01 +*** 4TH STREET *** +Player1 - Pocket [H H Js 10d] +PLAYER3 - Pocket [H H 6s Ah] +PLAYER4 - Pocket [10c 5c 7s] +PLAYER6 - Pocket [H H 9c Ks] +PLAYER7 - Pocket [H H 3s Qc] +PLAYER3 - Checks +PLAYER6 - Checks +PLAYER7 - Checks +Player1 - Checks +*** 5TH STREET *** +Player1 - Pocket [H H Js 10d Kh] +PLAYER3 - Pocket [H H 6s Ah 8c] +PLAYER4 - Pocket [10c 5c 7s] +PLAYER6 - Pocket [H H 9c Ks 10s] +PLAYER7 - Pocket [H H 3s Qc 6c] +PLAYER3 - Bets $0.04 +PLAYER6 - Calls $0.04 +PLAYER7 - Calls $0.04 +Player1 - Calls $0.04 +*** 6TH STREET *** +Player1 - Pocket [H H Js 10d Kh 2c] +PLAYER3 - Pocket [H H 6s Ah 8c Jc] +PLAYER4 - Pocket [10c 5c 7s] +PLAYER6 - Pocket [H H 9c Ks 10s 8h] +PLAYER7 - Pocket [H H 3s Qc 6c Qs] +PLAYER7 - Checks +Player1 - Checks +PLAYER3 - Bets $0.04 +PLAYER6 - Calls $0.04 +PLAYER7 - Calls $0.04 +Player1 - Calls $0.04 +*** RIVER *** +Player1 - Pocket [H H Js 10d Kh 2c H] +PLAYER3 - Pocket [H H 6s Ah 8c Jc H] +PLAYER4 - Pocket [10c 5c 7s] +PLAYER6 - Pocket [H H 9c Ks 10s 8h H] +PLAYER7 - Pocket [H H 3s Qc 6c Qs H] +PLAYER7 - Checks +Player1 - Checks +PLAYER3 - Checks +PLAYER6 - Checks +*** SHOW DOWN *** +PLAYER7 - Shows [5s 8d 3s Qc 6c Qs 9s] (One pair, queens) +Player1 - Shows [Jh 3h Js 10d Kh 2c 2h] (Two Pair, jacks and twos) +PLAYER3 - Shows [3d 5d 6s Ah 8c Jc As] (One pair, aces) +PLAYER6 - Shows [Kc 10h 9c Ks 10s 8h 2s] (Two Pair, kings and tens) +PLAYER3 Collects $0.19 from main pot +PLAYER6 Collects $0.20 from main pot +*** SUMMARY *** +Total Pot($0.43) | Rake ($0.04) +Seat 1: Player1 HI:lost with Two Pair, jacks and twos [Jh 3h Js 10d Kh 2c 2h - B:Js,P:Jh,P:2h,B:2c,B:Kh] +Seat 2: PLAYER2 Folded on the 3rd STREET +Seat 3: PLAYER3 won Total ($0.19) HI:with One pair, aces [3d 5d 6s Ah 8c Jc As - P:As,B:Ah,B:Jc,B:8c,B:6s] LO:($0.19) [B:Ah,P:3d,P:5d,B:6s,B:8c] +Seat 5: PLAYER4 Folded on the 3rd STREET +Seat 6: PLAYER5 Folded on the 3rd STREET +Seat 7: PLAYER6 won Total ($0.20) HI:($0.20) with Two Pair, kings and tens [Kc 10h 9c Ks 10s 8h 2s - B:Ks,P:Kc,B:10s,P:10h,B:9c] +Seat 8: PLAYER7 HI:lost with One pair, queens [5s 8d 3s Qc 6c Qs 9s - B:Qs,B:Qc,P:9s,P:8d,B:6c] + + + From d5f230e4e8ad896f0bc36000dbf06327cb726b5c Mon Sep 17 00:00:00 2001 From: Worros Date: Fri, 3 Sep 2010 11:49:41 +0800 Subject: [PATCH 12/33] Absolute: a couple of cleanups and some prep work for AP I've changed re_GameInfo to be a verbose regex, so I may have broken working hand histories. No test files at the moment so it is hard to tell. --- pyfpdb/AbsoluteToFpdb.py | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/pyfpdb/AbsoluteToFpdb.py b/pyfpdb/AbsoluteToFpdb.py index 7cef8c68..145a0971 100755 --- a/pyfpdb/AbsoluteToFpdb.py +++ b/pyfpdb/AbsoluteToFpdb.py @@ -23,6 +23,18 @@ import sys import logging from HandHistoryConverter import * +import locale +lang=locale.getdefaultlocale()[0][0:2] +if lang=="en": + def _(string): return string +else: + import gettext + try: + trans = gettext.translation("fpdb", localedir="locale", languages=[lang]) + trans.install() + except IOError: + def _(string): return string + # Class for converting Absolute HH format. class Absolute(HandHistoryConverter): @@ -42,7 +54,13 @@ class Absolute(HandHistoryConverter): #Seat 6 - FETS63 ($0.75 in chips) #Board [10s 5d Kh Qh 8c] - re_GameInfo = re.compile(ur"^Stage #(C?[0-9]+): (?PHoldem|HORSE)(?: \(1 on 1\)|)? ?(?PNo Limit|Pot Limit|Normal|)? ?(?P\$| €|)(?P[.0-9]+)/?(?:\$| €|)(?P[.0-9]+)?", re.MULTILINE) + re_GameInfo = re.compile(ur"""^Stage #(C?[0-9]+):\s+ + (?PHoldem|Seven\sCard\sHi\/L|HORSE) + (?:\s\(1\son\s1\)|)?\s+? + (?PNo Limit|Pot\sLimit|Normal|)?\s? + (?P\$|\s€|) + (?P[.0-9]+)/?(?:\$|\s€|)(?P[.0-9]+)? + """, re.MULTILINE|re.VERBOSE) re_HorseGameInfo = re.compile(ur"^Game Type: (?PLimit) (?PHoldem)", re.MULTILINE) # TODO: can set max seats via (1 on 1) to a known 2 .. re_HandInfo = re.compile(ur"^Stage #C?(?P[0-9]+): .*(?P\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d).*\n(Table: (?P.*) \(Real Money\))?", re.MULTILINE) @@ -50,12 +68,6 @@ class Absolute(HandHistoryConverter): re_Button = re.compile(ur"Seat #(?P
.+$)", re.MULTILINE) -# re_Button = re.compile(ur"^Seat (?P