From 0450424b51d91d65980cb51cb4d279f61e694b86 Mon Sep 17 00:00:00 2001 From: gimick Date: Tue, 28 Dec 2010 05:24:25 +0000 Subject: [PATCH 01/27] GUI: show 2dp for aggfac (sqlite only, fixed for other db's for code consistency) --- pyfpdb/SQL.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyfpdb/SQL.py b/pyfpdb/SQL.py index 6a87b433..d9629aa3 100644 --- a/pyfpdb/SQL.py +++ b/pyfpdb/SQL.py @@ -2239,7 +2239,7 @@ class Sql: end AS pofafq ,case when sum(cast(hp.street1Calls as integer))+ sum(cast(hp.street2Calls as integer))+ sum(cast(hp.street3Calls as integer))+ sum(cast(hp.street4Calls as integer)) = 0 then -999 else (sum(cast(hp.street1Aggr as integer)) + sum(cast(hp.street2Aggr as integer)) + sum(cast(hp.street3Aggr as integer)) + sum(cast(hp.street4Aggr as integer))) - /(sum(cast(hp.street1Calls as integer))+ sum(cast(hp.street2Calls as integer))+ sum(cast(hp.street3Calls as integer))+ sum(cast(hp.street4Calls as integer))) + /(0.0+sum(cast(hp.street1Calls as integer))+ sum(cast(hp.street2Calls as integer))+ sum(cast(hp.street3Calls as integer))+ sum(cast(hp.street4Calls as integer))) end AS aggfac ,100.0*(sum(cast(hp.street1Aggr as integer)) + sum(cast(hp.street2Aggr as integer)) + sum(cast(hp.street3Aggr as integer)) + sum(cast(hp.street4Aggr as integer))) / ((sum(cast(hp.foldToOtherRaisedStreet1 as integer))+ sum(cast(hp.foldToOtherRaisedStreet2 as integer))+ sum(cast(hp.foldToOtherRaisedStreet3 as integer))+ sum(cast(hp.foldToOtherRaisedStreet4 as integer))) + @@ -2360,7 +2360,7 @@ class Sql: end AS pofafq ,case when sum(cast(hp.street1Calls as integer))+ sum(cast(hp.street2Calls as integer))+ sum(cast(hp.street3Calls as integer))+ sum(cast(hp.street4Calls as integer)) = 0 then -999 else (sum(cast(hp.street1Aggr as integer)) + sum(cast(hp.street2Aggr as integer)) + sum(cast(hp.street3Aggr as integer)) + sum(cast(hp.street4Aggr as integer))) - /(sum(cast(hp.street1Calls as integer))+ sum(cast(hp.street2Calls as integer))+ sum(cast(hp.street3Calls as integer))+ sum(cast(hp.street4Calls as integer))) + /(0.0+sum(cast(hp.street1Calls as integer))+ sum(cast(hp.street2Calls as integer))+ sum(cast(hp.street3Calls as integer))+ sum(cast(hp.street4Calls as integer))) end AS aggfac ,100.0*(sum(cast(hp.street1Aggr as integer)) + sum(cast(hp.street2Aggr as integer)) + sum(cast(hp.street3Aggr as integer)) + sum(cast(hp.street4Aggr as integer))) / ((sum(cast(hp.foldToOtherRaisedStreet1 as integer))+ sum(cast(hp.foldToOtherRaisedStreet2 as integer))+ sum(cast(hp.foldToOtherRaisedStreet3 as integer))+ sum(cast(hp.foldToOtherRaisedStreet4 as integer))) + @@ -2482,7 +2482,7 @@ class Sql: end AS pofafq ,case when sum(cast(hp.street1Calls as integer))+ sum(cast(hp.street2Calls as integer))+ sum(cast(hp.street3Calls as integer))+ sum(cast(hp.street4Calls as integer)) = 0 then -999 else (sum(cast(hp.street1Aggr as integer)) + sum(cast(hp.street2Aggr as integer)) + sum(cast(hp.street3Aggr as integer)) + sum(cast(hp.street4Aggr as integer))) - /(sum(cast(hp.street1Calls as integer))+ sum(cast(hp.street2Calls as integer))+ sum(cast(hp.street3Calls as integer))+ sum(cast(hp.street4Calls as integer))) + /(0.0+sum(cast(hp.street1Calls as integer))+ sum(cast(hp.street2Calls as integer))+ sum(cast(hp.street3Calls as integer))+ sum(cast(hp.street4Calls as integer))) end AS aggfac ,100.0*(sum(cast(hp.street1Aggr as integer)) + sum(cast(hp.street2Aggr as integer)) + sum(cast(hp.street3Aggr as integer)) + sum(cast(hp.street4Aggr as integer))) / ((sum(cast(hp.foldToOtherRaisedStreet1 as integer))+ sum(cast(hp.foldToOtherRaisedStreet2 as integer))+ sum(cast(hp.foldToOtherRaisedStreet3 as integer))+ sum(cast(hp.foldToOtherRaisedStreet4 as integer))) + From 4539fe4d898d071e139421ecb58ed7dddbbd50e0 Mon Sep 17 00:00:00 2001 From: Eratosthenes Date: Thu, 3 Feb 2011 10:19:39 -0500 Subject: [PATCH 02/27] Change hand no back to approx the way Carl had it. --- pyfpdb/WinamaxToFpdb.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pyfpdb/WinamaxToFpdb.py b/pyfpdb/WinamaxToFpdb.py index 2baf3558..f42714be 100644 --- a/pyfpdb/WinamaxToFpdb.py +++ b/pyfpdb/WinamaxToFpdb.py @@ -219,13 +219,15 @@ class Winamax(HandHistoryConverter): # TODO: Manually adjust time against OFFSET hand.startTime = datetime.datetime.strptime(datetimestr, "%Y/%m/%d %H:%M:%S") # also timezone at end, e.g. " ET" hand.startTime = HandHistoryConverter.changeTimezone(hand.startTime, "CET", "UTC") -# if key == 'HID1': -# # Need to remove non-alphanumerics for MySQL + if key == 'HID1': + # Need to remove non-alphanumerics for MySQL # hand.handid = "1%.9d%s%s"%(int(info['HID2']),info['HID1'],info['HID3']) -# if len (hand.handid) > 19: -# hand.handid = "%s" % info['HID1'] - if key == 'HID3': - hand.handid = int(info['HID3']) # correct hand no (REB) + hand.handid = "%s%s%s"%(int(info['HID2']),info['HID1'],info['HID3']) + if len (hand.handid) > 19: + hand.handid = "%s%s" % (int(info['HID21']), int(info['HID3'])) + +# if key == 'HID3': +# hand.handid = int(info['HID3']) # correct hand no (REB) if key == 'TOURNO': hand.tourNo = info[key] if key == 'TABLE': From 6b384634f84e7422d01e72b81f63e26be5378637 Mon Sep 17 00:00:00 2001 From: Worros Date: Fri, 4 Feb 2011 13:00:59 +0800 Subject: [PATCH 03/27] Regression: Fix Stars foldto3/4bet for Allin-pre.txt --- .../Flop/NLHE-6max-USD-0.05-0.10-200912.Allin-pre.txt.hp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyfpdb/regression-test-files/cash/Stars/Flop/NLHE-6max-USD-0.05-0.10-200912.Allin-pre.txt.hp b/pyfpdb/regression-test-files/cash/Stars/Flop/NLHE-6max-USD-0.05-0.10-200912.Allin-pre.txt.hp index 826d4bba..1c131411 100644 --- a/pyfpdb/regression-test-files/cash/Stars/Flop/NLHE-6max-USD-0.05-0.10-200912.Allin-pre.txt.hp +++ b/pyfpdb/regression-test-files/cash/Stars/Flop/NLHE-6max-USD-0.05-0.10-200912.Allin-pre.txt.hp @@ -49,7 +49,7 @@ 'street0_4BDone': False, 'street0_FoldTo3BChance': False, 'street0_FoldTo3BDone': False, - 'street0_FoldTo4BChance': False, + 'street0_FoldTo4BChance': True, 'street0_FoldTo4BDone': False, 'street1Aggr': False, 'street1Bets': 0, @@ -537,7 +537,7 @@ 'street0_3BDone': False, 'street0_4BChance': True, 'street0_4BDone': True, - 'street0_FoldTo3BChance': False, + 'street0_FoldTo3BChance': True, 'street0_FoldTo3BDone': False, 'street0_FoldTo4BChance': False, 'street0_FoldTo4BDone': False, From 5ff3e414eb6adb2f86c81eeead40abcc2fe158f6 Mon Sep 17 00:00:00 2001 From: Worros Date: Fri, 4 Feb 2011 17:18:10 +0800 Subject: [PATCH 04/27] Winamax: Major revision to readCollected This should fix most issues with the way Winamax writes its hand histories. --- pyfpdb/WinamaxToFpdb.py | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/pyfpdb/WinamaxToFpdb.py b/pyfpdb/WinamaxToFpdb.py index f42714be..b8b5ed1e 100644 --- a/pyfpdb/WinamaxToFpdb.py +++ b/pyfpdb/WinamaxToFpdb.py @@ -107,6 +107,7 @@ class Winamax(HandHistoryConverter): re_TailSplitHands = re.compile(r'\n\s*\n') re_Button = re.compile(r'Seat\s#(?P