diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..3d8ec313 --- /dev/null +++ b/Makefile @@ -0,0 +1,11 @@ +# Variable definitions +VERSION = 0.12 +DATE = $(shell date +%Y%m%d) + +all: + @echo "Usage:" + @echo " make snapshot - Tags the repository with $(VERSION)-$(DATE) and creates a tarball from that" + +snapshot: + git tag $(VERSION)-$(DATE) + git archive --prefix=fpdb-$(VERSION)-$(DATE)/ $(VERSION)-$(DATE) | gzip -9 > ../fpdb-$(VERSION)-$(DATE).tar.gz diff --git a/pyfpdb/DerivedStats.py b/pyfpdb/DerivedStats.py index a63a3636..e4072d8a 100644 --- a/pyfpdb/DerivedStats.py +++ b/pyfpdb/DerivedStats.py @@ -231,8 +231,9 @@ class DerivedStats(): pas = set.union(self.pfba(actions) - self.pfba(actions, l=('folds',)), alliners) self.hands['playersAtShowdown'] = len(pas) - for player in pas: - self.handsplayers[player]['sawShowdown'] = True + if self.hands['playersAtShowdown'] > 1: + for player in pas: + self.handsplayers[player]['sawShowdown'] = True def streetXRaises(self, hand): # self.actions[street] is a list of all actions in a tuple, contining the action as the second element diff --git a/pyfpdb/HUD_config.test.xml b/pyfpdb/HUD_config.test.xml index 52905a70..1a5f77fa 100644 --- a/pyfpdb/HUD_config.test.xml +++ b/pyfpdb/HUD_config.test.xml @@ -574,7 +574,7 @@ Left-Drag to Move" - + diff --git a/pyfpdb/HUD_main.py b/pyfpdb/HUD_main.py index 178e2352..2a1829ae 100755 --- a/pyfpdb/HUD_main.py +++ b/pyfpdb/HUD_main.py @@ -169,10 +169,10 @@ class HUD_main(object): # function idle_func() to be run by the gui thread, at its leisure. def idle_func(): gtk.gdk.threads_enter() - self.hud_dict[table_name].update(new_hand_id, config) + try: + self.hud_dict[table_name].update(new_hand_id, config) # The HUD could get destroyed in the above call ^^, which leaves us with a KeyError here vv # if we ever get an error we need to expect ^^ then we need to handle it vv - Eric - try: [aw.update_gui(new_hand_id) for aw in self.hud_dict[table_name].aux_windows] except KeyError: pass diff --git a/pyfpdb/Hand.py b/pyfpdb/Hand.py index efa9c0b6..9ff78249 100644 --- a/pyfpdb/Hand.py +++ b/pyfpdb/Hand.py @@ -54,6 +54,7 @@ class Hand(object): self.starttime = 0 self.handText = handText self.handid = 0 + self.dbid_hands = 0 self.tablename = "" self.hero = "" self.maxseats = None @@ -218,8 +219,8 @@ db: a connected fpdb_db object""" # seats TINYINT NOT NULL, hh['seats'] = len(sqlids) - handid = db.storeHand(hh) - db.storeHandsPlayers(handid, sqlids, self.stats.getHandsPlayers()) + self.dbid_hands = db.storeHand(hh) + db.storeHandsPlayers(self.dbid_hands, sqlids, self.stats.getHandsPlayers()) # HandsActions - all actions for all players for all streets - self.actions # HudCache data can be generated from HandsActions (HandsPlayers?) # Tourneys ? diff --git a/pyfpdb/fpdb_import.py b/pyfpdb/fpdb_import.py index 7a25fc70..760e1f01 100644 --- a/pyfpdb/fpdb_import.py +++ b/pyfpdb/fpdb_import.py @@ -437,6 +437,11 @@ class Importer: #try, except duplicates here? #hand.prepInsert() hand.insert(self.database) + if self.callHud and hand.dbid_hands != 0: + #print "DEBUG: call to HUD: handsId: %s" % hand.dbid_hands + #pipe the Hands.id out to the HUD + # print "fpdb_import: sending hand to hud", handsId, "pipe =", self.caller.pipe_to_hud + self.caller.pipe_to_hud.stdin.write("%s" % (hand.dbid_hands) + os.linesep) errors = getattr(hhc, 'numErrors') stored = getattr(hhc, 'numHands') diff --git a/pyfpdb/regression-test-files/cash/Stars/Flop/NLHE-6max-USD-0.05-0.10-200912.Stats-comparision.txt b/pyfpdb/regression-test-files/cash/Stars/Flop/NLHE-6max-USD-0.05-0.10-200912.Stats-comparision.txt new file mode 100644 index 00000000..5f140759 --- /dev/null +++ b/pyfpdb/regression-test-files/cash/Stars/Flop/NLHE-6max-USD-0.05-0.10-200912.Stats-comparision.txt @@ -0,0 +1,43 @@ +PokerStars Game #36185273365: Hold'em No Limit ($0.05/$0.10 USD) - 2009/12/03 9:16:10 ET +Table 'Eurynome IV' 6-max Seat #3 is the button +Seat 1: s0rrow ($16.10 in chips) +Seat 2: chrisbiz ($9.45 in chips) +Seat 3: papajohn77 ($6.55 in chips) +Seat 4: WSOFish ($21.05 in chips) +Seat 5: drefron ($10 in chips) +Seat 6: garegerret ($10.60 in chips) +WSOFish: posts small blind $0.05 +drefron: posts big blind $0.10 +*** HOLE CARDS *** +Dealt to s0rrow [5s As] +garegerret: folds +s0rrow: raises $0.20 to $0.30 +chrisbiz: calls $0.30 +papajohn77: folds +WSOFish: folds +drefron: folds +*** FLOP *** [8c 4c 4d] +s0rrow: checks +chrisbiz: bets $0.40 +s0rrow: raises $1 to $1.40 +chrisbiz: calls $1 +*** TURN *** [8c 4c 4d] [Kc] +s0rrow: bets $3.20 +chrisbiz: calls $3.20 +*** RIVER *** [8c 4c 4d Kc] [2s] +s0rrow: bets $11.20 and is all-in +chrisbiz: folds +Uncalled bet ($11.20) returned to s0rrow +s0rrow collected $9.50 from pot +*** SUMMARY *** +Total pot $9.95 | Rake $0.45 +Board [8c 4c 4d Kc 2s] +Seat 1: s0rrow collected ($9.50) +Seat 2: chrisbiz folded on the River +Seat 3: papajohn77 (button) folded before Flop (didn't bet) +Seat 4: WSOFish (small blind) folded before Flop +Seat 5: drefron (big blind) folded before Flop +Seat 6: garegerret folded before Flop (didn't bet) + + + diff --git a/pyfpdb/regression-test-files/cash/Stars/Flop/PLO8-6max-USD-0.01-0.02-200911.txt b/pyfpdb/regression-test-files/cash/Stars/Flop/PLO8-6max-USD-0.01-0.02-200911.txt new file mode 100644 index 00000000..fb96f3f9 --- /dev/null +++ b/pyfpdb/regression-test-files/cash/Stars/Flop/PLO8-6max-USD-0.01-0.02-200911.txt @@ -0,0 +1,602 @@ +PokerStars Game #35874998500: Omaha Hi/Lo Pot Limit ($0.01/$0.02 USD) - 2009/11/26 10:36:51 ET +Table 'Gaby II' 6-max Seat #3 is the button +Seat 1: EricSteph261 ($11.27 in chips) +Seat 2: UnderMeSensi ($3.33 in chips) +Seat 3: supermeXXX ($1.19 in chips) +Seat 4: xgz520 ($1.81 in chips) +Seat 5: s0rrow ($3 in chips) +Seat 6: tiger48475 ($5 in chips) +xgz520: posts small blind $0.01 +s0rrow: posts big blind $0.02 +*** HOLE CARDS *** +Dealt to s0rrow [2h 2c 3s 9h] +tiger48475: folds +EricSteph261: folds +UnderMeSensi: raises $0.05 to $0.07 +supermeXXX: folds +xgz520: folds +s0rrow: calls $0.05 +*** FLOP *** [Jd 5c Kc] +s0rrow: checks +UnderMeSensi: checks +*** TURN *** [Jd 5c Kc] [4c] +s0rrow: checks +UnderMeSensi: bets $0.08 +s0rrow: calls $0.08 +*** RIVER *** [Jd 5c Kc 4c] [Th] +s0rrow: checks +UnderMeSensi: bets $0.31 +EricSteph261 is sitting out +s0rrow: folds +Uncalled bet ($0.31) returned to UnderMeSensi +UnderMeSensi collected $0.31 from pot +UnderMeSensi: doesn't show hand +*** SUMMARY *** +Total pot $0.31 | Rake $0 +Board [Jd 5c Kc 4c Th] +Seat 1: EricSteph261 folded before Flop (didn't bet) +Seat 2: UnderMeSensi collected ($0.31) +Seat 3: supermeXXX (button) folded before Flop (didn't bet) +Seat 4: xgz520 (small blind) folded before Flop +Seat 5: s0rrow (big blind) folded on the River +Seat 6: tiger48475 folded before Flop (didn't bet) + + + +PokerStars Game #35875026976: Omaha Hi/Lo Pot Limit ($0.01/$0.02 USD) - 2009/11/26 10:37:39 ET +Table 'Gaby II' 6-max Seat #4 is the button +Seat 2: UnderMeSensi ($3.49 in chips) +Seat 3: supermeXXX ($1.19 in chips) +Seat 4: xgz520 ($1.80 in chips) +Seat 5: s0rrow ($2.85 in chips) +Seat 6: tiger48475 ($5 in chips) +s0rrow: posts small blind $0.01 +tiger48475: posts big blind $0.02 +*** HOLE CARDS *** +Dealt to s0rrow [4d 3s 8d Jd] +UnderMeSensi: raises $0.05 to $0.07 +supermeXXX: folds +xgz520: folds +s0rrow: folds +tiger48475: folds +Uncalled bet ($0.05) returned to UnderMeSensi +xgz520 leaves the table +UnderMeSensi collected $0.05 from pot +UnderMeSensi: doesn't show hand +*** SUMMARY *** +Total pot $0.05 | Rake $0 +Seat 2: UnderMeSensi collected ($0.05) +Seat 3: supermeXXX folded before Flop (didn't bet) +Seat 4: xgz520 (button) folded before Flop (didn't bet) +Seat 5: s0rrow (small blind) folded before Flop +Seat 6: tiger48475 (big blind) folded before Flop + + + +PokerStars Game #35875034981: Omaha Hi/Lo Pot Limit ($0.01/$0.02 USD) - 2009/11/26 10:37:53 ET +Table 'Gaby II' 6-max Seat #5 is the button +Seat 2: UnderMeSensi ($3.52 in chips) +Seat 3: supermeXXX ($1.19 in chips) +Seat 5: s0rrow ($2.84 in chips) +Seat 6: tiger48475 ($5 in chips) +tiger48475: posts small blind $0.01 +UnderMeSensi: posts big blind $0.02 +*** HOLE CARDS *** +Dealt to s0rrow [Qh 6c Th 9c] +supermeXXX: raises $0.04 to $0.06 +s0rrow: calls $0.06 +tiger48475: folds +UnderMeSensi: calls $0.04 +*** FLOP *** [5h 4d 2d] +UnderMeSensi: checks +supermeXXX: bets $0.10 +s0rrow: folds +UnderMeSensi: calls $0.10 +*** TURN *** [5h 4d 2d] [Jd] +UnderMeSensi: checks +supermeXXX: checks +*** RIVER *** [5h 4d 2d Jd] [6h] +UnderMeSensi: checks +supermeXXX: checks +*** SHOW DOWN *** +UnderMeSensi: shows [7c 6s 7h As] (HI: a pair of Sevens; LO: 6,5,4,2,A) +supermeXXX: shows [Ah 2h Kh 2s] (HI: three of a kind, Deuces; LO: 6,5,4,2,A) +supermeXXX collected $0.20 from pot +UnderMeSensi collected $0.10 from pot +supermeXXX collected $0.09 from pot +*** SUMMARY *** +Total pot $0.39 | Rake $0 +Board [5h 4d 2d Jd 6h] +Seat 2: UnderMeSensi (big blind) showed [7c 6s 7h As] and won ($0.10) with HI: a pair of Sevens; LO: 6,5,4,2,A +Seat 3: supermeXXX showed [Ah 2h Kh 2s] and won ($0.29) with HI: three of a kind, Deuces; LO: 6,5,4,2,A +Seat 5: s0rrow (button) folded on the Flop +Seat 6: tiger48475 (small blind) folded before Flop + + + +PokerStars Game #35875059163: Omaha Hi/Lo Pot Limit ($0.01/$0.02 USD) - 2009/11/26 10:38:34 ET +Table 'Gaby II' 6-max Seat #6 is the button +Seat 2: UnderMeSensi ($3.46 in chips) +Seat 3: supermeXXX ($1.32 in chips) +Seat 5: s0rrow ($2.78 in chips) +Seat 6: tiger48475 ($5 in chips) +UnderMeSensi: posts small blind $0.01 +supermeXXX: posts big blind $0.02 +*** HOLE CARDS *** +Dealt to s0rrow [Ts Qs 9d 7c] +s0rrow: raises $0.04 to $0.06 +tiger48475: folds +UnderMeSensi: calls $0.05 +diyi69 joins the table at seat #4 +supermeXXX: folds +*** FLOP *** [3h Ah 5d] +UnderMeSensi: checks +s0rrow: checks +*** TURN *** [3h Ah 5d] [Kc] +UnderMeSensi: checks +s0rrow: bets $0.14 +UnderMeSensi: folds +Uncalled bet ($0.14) returned to s0rrow +s0rrow collected $0.14 from pot +*** SUMMARY *** +Total pot $0.14 | Rake $0 +Board [3h Ah 5d Kc] +Seat 2: UnderMeSensi (small blind) folded on the Turn +Seat 3: supermeXXX (big blind) folded before Flop +Seat 5: s0rrow collected ($0.14) +Seat 6: tiger48475 (button) folded before Flop (didn't bet) + + + +PokerStars Game #35875079294: Omaha Hi/Lo Pot Limit ($0.01/$0.02 USD) - 2009/11/26 10:39:09 ET +Table 'Gaby II' 6-max Seat #2 is the button +Seat 2: UnderMeSensi ($3.40 in chips) +Seat 3: supermeXXX ($1.30 in chips) +Seat 4: diyi69 ($1 in chips) +Seat 5: s0rrow ($2.86 in chips) +Seat 6: tiger48475 ($5 in chips) +supermeXXX: posts small blind $0.01 +diyi69: posts big blind $0.02 +*** HOLE CARDS *** +Dealt to s0rrow [8s 6d 7s 2s] +s0rrow: folds +tiger48475: folds +UnderMeSensi: folds +supermeXXX: calls $0.01 +diyi69 has timed out +diyi69: checks +*** FLOP *** [As Js 5h] +supermeXXX: bets $0.04 +diyi69 has timed out +diyi69: folds +Uncalled bet ($0.04) returned to supermeXXX +diyi69 is sitting out +supermeXXX collected $0.04 from pot +*** SUMMARY *** +Total pot $0.04 | Rake $0 +Board [As Js 5h] +Seat 2: UnderMeSensi (button) folded before Flop (didn't bet) +Seat 3: supermeXXX (small blind) collected ($0.04) +Seat 4: diyi69 (big blind) folded on the Flop +Seat 5: s0rrow folded before Flop (didn't bet) +Seat 6: tiger48475 folded before Flop (didn't bet) + + + +PokerStars Game #35875131707: Omaha Hi/Lo Pot Limit ($0.01/$0.02 USD) - 2009/11/26 10:40:40 ET +Table 'Gaby II' 6-max Seat #3 is the button +Seat 2: UnderMeSensi ($3.40 in chips) +Seat 3: supermeXXX ($1.32 in chips) +Seat 5: s0rrow ($2.86 in chips) +Seat 6: tiger48475 ($5 in chips) +s0rrow: posts small blind $0.01 +tiger48475: posts big blind $0.02 +*** HOLE CARDS *** +Dealt to s0rrow [7c As 4d 4h] +UnderMeSensi: calls $0.02 +supermeXXX: folds +s0rrow: calls $0.01 +tiger48475: checks +*** FLOP *** [Ks 9d Ts] +s0rrow: checks +tiger48475: bets $0.06 +UnderMeSensi: calls $0.06 +s0rrow: folds +*** TURN *** [Ks 9d Ts] [7h] +tiger48475: checks +EricSteph261 has returned +UnderMeSensi: checks +*** RIVER *** [Ks 9d Ts 7h] [4s] +tiger48475: checks +UnderMeSensi: bets $0.10 +tiger48475: folds +Uncalled bet ($0.10) returned to UnderMeSensi +UnderMeSensi collected $0.18 from pot +UnderMeSensi: doesn't show hand +*** SUMMARY *** +Total pot $0.18 | Rake $0 +Board [Ks 9d Ts 7h 4s] +Seat 2: UnderMeSensi collected ($0.18) +Seat 3: supermeXXX (button) folded before Flop (didn't bet) +Seat 5: s0rrow (small blind) folded on the Flop +Seat 6: tiger48475 (big blind) folded on the River + + + +PokerStars Game #35875159084: Omaha Hi/Lo Pot Limit ($0.01/$0.02 USD) - 2009/11/26 10:41:27 ET +Table 'Gaby II' 6-max Seat #5 is the button +Seat 1: EricSteph261 ($11.27 in chips) +Seat 2: UnderMeSensi ($3.50 in chips) +Seat 3: supermeXXX ($1.32 in chips) +Seat 5: s0rrow ($2.84 in chips) +Seat 6: tiger48475 ($5 in chips) +tiger48475: posts small blind $0.01 +EricSteph261: posts big blind $0.02 +*** HOLE CARDS *** +Dealt to s0rrow [Jc 3h 2s Qc] +UnderMeSensi: calls $0.02 +supermeXXX: calls $0.02 +s0rrow: raises $0.08 to $0.10 +tiger48475: folds +EricSteph261: folds +UnderMeSensi: calls $0.08 +supermeXXX: folds +*** FLOP *** [Ac 5s Js] +UnderMeSensi: checks +s0rrow: bets $0.20 +UnderMeSensi: calls $0.20 +*** TURN *** [Ac 5s Js] [8c] +UnderMeSensi: checks +s0rrow: bets $0.50 +UnderMeSensi: calls $0.50 +*** RIVER *** [Ac 5s Js 8c] [Jd] +UnderMeSensi: bets $1.60 +s0rrow: calls $1.60 +*** SHOW DOWN *** +UnderMeSensi: shows [7s 9s Jh 3c] (HI: three of a kind, Jacks; LO: 8,7,5,3,A) +s0rrow: shows [Jc 3h 2s Qc] (HI: three of a kind, Jacks - Ace+Queen kicker; LO: 8,5,3,2,A) +s0rrow collected $2.33 from pot +s0rrow collected $2.32 from pot +*** SUMMARY *** +Total pot $4.85 | Rake $0.20 +Board [Ac 5s Js 8c Jd] +Seat 1: EricSteph261 (big blind) folded before Flop +Seat 2: UnderMeSensi showed [7s 9s Jh 3c] and lost with HI: three of a kind, Jacks; LO: 8,7,5,3,A +Seat 3: supermeXXX folded before Flop +Seat 5: s0rrow (button) showed [Jc 3h 2s Qc] and won ($4.65) with HI: three of a kind, Jacks; LO: 8,5,3,2,A +Seat 6: tiger48475 (small blind) folded before Flop + + + +PokerStars Game #35875194885: Omaha Hi/Lo Pot Limit ($0.01/$0.02 USD) - 2009/11/26 10:42:28 ET +Table 'Gaby II' 6-max Seat #6 is the button +Seat 1: EricSteph261 ($11.25 in chips) +Seat 2: UnderMeSensi ($1.10 in chips) +Seat 3: supermeXXX ($1.30 in chips) +Seat 5: s0rrow ($5.09 in chips) +Seat 6: tiger48475 ($5 in chips) +EricSteph261: posts small blind $0.01 +UnderMeSensi: posts big blind $0.02 +*** HOLE CARDS *** +Dealt to s0rrow [7s 3c 3h 8d] +supermeXXX: folds +s0rrow: raises $0.02 to $0.04 +tiger48475: calls $0.04 +EricSteph261: calls $0.03 +UnderMeSensi: calls $0.02 +*** FLOP *** [8c 3s 4s] +EricSteph261: checks +UnderMeSensi: checks +s0rrow: bets $0.14 +tiger48475: folds +EricSteph261: folds +UnderMeSensi: folds +Uncalled bet ($0.14) returned to s0rrow +s0rrow collected $0.16 from pot +*** SUMMARY *** +Total pot $0.16 | Rake $0 +Board [8c 3s 4s] +Seat 1: EricSteph261 (small blind) folded on the Flop +Seat 2: UnderMeSensi (big blind) folded on the Flop +Seat 3: supermeXXX folded before Flop (didn't bet) +Seat 5: s0rrow collected ($0.16) +Seat 6: tiger48475 (button) folded on the Flop + + + +PokerStars Game #35875219121: Omaha Hi/Lo Pot Limit ($0.01/$0.02 USD) - 2009/11/26 10:43:08 ET +Table 'Gaby II' 6-max Seat #1 is the button +Seat 1: EricSteph261 ($11.21 in chips) +Seat 2: UnderMeSensi ($1.06 in chips) +Seat 3: supermeXXX ($1.30 in chips) +Seat 5: s0rrow ($5.21 in chips) +Seat 6: tiger48475 ($5 in chips) +UnderMeSensi: posts small blind $0.01 +supermeXXX: posts big blind $0.02 +*** HOLE CARDS *** +Dealt to s0rrow [Ks Qd Kd Kc] +s0rrow: raises $0.04 to $0.06 +tiger48475: folds +EricSteph261: calls $0.06 +UnderMeSensi: calls $0.05 +supermeXXX: calls $0.04 +*** FLOP *** [2d Jh 5h] +UnderMeSensi: checks +supermeXXX: checks +s0rrow: checks +EricSteph261: checks +*** TURN *** [2d Jh 5h] [Js] +UnderMeSensi: checks +supermeXXX: checks +s0rrow: checks +EricSteph261: checks +*** RIVER *** [2d Jh 5h Js] [7s] +UnderMeSensi: checks +supermeXXX: checks +s0rrow: checks +EricSteph261: checks +*** SHOW DOWN *** +UnderMeSensi: shows [5d 6c As 9d] (HI: two pair, Jacks and Fives; LO: 7,6,5,2,A) +supermeXXX: shows [6s Th 7c Ac] (HI: two pair, Jacks and Sevens; LO: 7,6,5,2,A) +s0rrow: shows [Ks Qd Kd Kc] (HI: two pair, Kings and Jacks) +EricSteph261: shows [4s 9c 3d 2c] (HI: two pair, Jacks and Deuces; LO: 7,5,4,3,2) +s0rrow collected $0.12 from pot +EricSteph261 collected $0.12 from pot +*** SUMMARY *** +Total pot $0.24 | Rake $0 +Board [2d Jh 5h Js 7s] +Seat 1: EricSteph261 (button) showed [4s 9c 3d 2c] and won ($0.12) with HI: two pair, Jacks and Deuces; LO: 7,5,4,3,2 +Seat 2: UnderMeSensi (small blind) showed [5d 6c As 9d] and lost with HI: two pair, Jacks and Fives; LO: 7,6,5,2,A +Seat 3: supermeXXX (big blind) showed [6s Th 7c Ac] and lost with HI: two pair, Jacks and Sevens; LO: 7,6,5,2,A +Seat 5: s0rrow showed [Ks Qd Kd Kc] and won ($0.12) with HI: two pair, Kings and Jacks +Seat 6: tiger48475 folded before Flop (didn't bet) + + + +PokerStars Game #35875246335: Omaha Hi/Lo Pot Limit ($0.01/$0.02 USD) - 2009/11/26 10:43:54 ET +Table 'Gaby II' 6-max Seat #2 is the button +Seat 1: EricSteph261 ($11.27 in chips) +Seat 2: UnderMeSensi ($1 in chips) +Seat 3: supermeXXX ($1.24 in chips) +Seat 5: s0rrow ($5.27 in chips) +Seat 6: tiger48475 ($5 in chips) +supermeXXX: posts small blind $0.01 +s0rrow: posts big blind $0.02 +*** HOLE CARDS *** +Dealt to s0rrow [Jd Kc 6h Jc] +tiger48475: folds +EricSteph261: calls $0.02 +UnderMeSensi is disconnected +UnderMeSensi has timed out while disconnected +UnderMeSensi: folds +UnderMeSensi is sitting out +supermeXXX: calls $0.01 +s0rrow: checks +*** FLOP *** [8d 7s Qh] +supermeXXX: bets $0.02 +s0rrow: folds +EricSteph261: calls $0.02 +*** TURN *** [8d 7s Qh] [As] +supermeXXX: bets $0.04 +EricSteph261: calls $0.04 +*** RIVER *** [8d 7s Qh As] [5d] +supermeXXX: checks +EricSteph261: checks +*** SHOW DOWN *** +supermeXXX: shows [Kh Qd 9s Th] (HI: a pair of Queens) +EricSteph261: shows [Jh 2d 5s 6c] (HI: a pair of Fives; LO: 7,6,5,2,A) +supermeXXX collected $0.09 from pot +EricSteph261 collected $0.09 from pot +*** SUMMARY *** +Total pot $0.18 | Rake $0 +Board [8d 7s Qh As 5d] +Seat 1: EricSteph261 showed [Jh 2d 5s 6c] and won ($0.09) with HI: a pair of Fives; LO: 7,6,5,2,A +Seat 2: UnderMeSensi (button) folded before Flop (didn't bet) +Seat 3: supermeXXX (small blind) showed [Kh Qd 9s Th] and won ($0.09) with HI: a pair of Queens +Seat 5: s0rrow (big blind) folded on the Flop +Seat 6: tiger48475 folded before Flop (didn't bet) + + + +PokerStars Game #35875293439: Omaha Hi/Lo Pot Limit ($0.01/$0.02 USD) - 2009/11/26 10:45:14 ET +Table 'Gaby II' 6-max Seat #3 is the button +Seat 1: EricSteph261 ($11.28 in chips) +Seat 3: supermeXXX ($1.25 in chips) +Seat 5: s0rrow ($5.25 in chips) +Seat 6: tiger48475 ($5 in chips) +s0rrow: posts small blind $0.01 +tiger48475: posts big blind $0.02 +*** HOLE CARDS *** +Dealt to s0rrow [9c 8h 8s 3c] +EricSteph261: calls $0.02 +supermeXXX: calls $0.02 +s0rrow: calls $0.01 +tiger48475: checks +*** FLOP *** [Ah 2d Qc] +s0rrow: checks +tiger48475: checks +EricSteph261: checks +supermeXXX: checks +*** TURN *** [Ah 2d Qc] [3d] +s0rrow: checks +tiger48475: checks +EricSteph261: checks +supermeXXX: checks +*** RIVER *** [Ah 2d Qc 3d] [6s] +s0rrow: checks +tiger48475: checks +EricSteph261: checks +supermeXXX: checks +*** SHOW DOWN *** +s0rrow: shows [9c 8h 8s 3c] (HI: a pair of Eights; LO: 8,6,3,2,A) +tiger48475: shows [3s 5s Ts Th] (HI: a pair of Tens; LO: 6,5,3,2,A) +EricSteph261: shows [As Ks Jh 7h] (HI: a pair of Aces; LO: 7,6,3,2,A) +supermeXXX: mucks hand +EricSteph261 collected $0.04 from pot +tiger48475 collected $0.04 from pot +*** SUMMARY *** +Total pot $0.08 | Rake $0 +Board [Ah 2d Qc 3d 6s] +Seat 1: EricSteph261 showed [As Ks Jh 7h] and won ($0.04) with HI: a pair of Aces; LO: 7,6,3,2,A +Seat 3: supermeXXX (button) mucked [9h 9s 4c Kc] +Seat 5: s0rrow (small blind) showed [9c 8h 8s 3c] and lost with HI: a pair of Eights; LO: 8,6,3,2,A +Seat 6: tiger48475 (big blind) showed [3s 5s Ts Th] and won ($0.04) with HI: a pair of Tens; LO: 6,5,3,2,A + + + +PokerStars Game #35875328026: Omaha Hi/Lo Pot Limit ($0.01/$0.02 USD) - 2009/11/26 10:46:13 ET +Table 'Gaby II' 6-max Seat #5 is the button +Seat 1: EricSteph261 ($11.30 in chips) +Seat 3: supermeXXX ($1.23 in chips) +Seat 5: s0rrow ($5.23 in chips) +Seat 6: tiger48475 ($5.02 in chips) +tiger48475: posts small blind $0.01 +EricSteph261: posts big blind $0.02 +*** HOLE CARDS *** +Dealt to s0rrow [Qd 6h 8s 6c] +supermeXXX: calls $0.02 +s0rrow: folds +tiger48475: calls $0.01 +EricSteph261: checks +*** FLOP *** [Kc Ac 5s] +tiger48475: checks +EricSteph261: checks +supermeXXX: checks +*** TURN *** [Kc Ac 5s] [3h] +tiger48475: checks +EricSteph261: checks +supermeXXX: checks +*** RIVER *** [Kc Ac 5s 3h] [Qh] +tiger48475: bets $0.06 +EricSteph261: folds +EricSteph261 is sitting out +supermeXXX: folds +Uncalled bet ($0.06) returned to tiger48475 +tiger48475 collected $0.06 from pot +*** SUMMARY *** +Total pot $0.06 | Rake $0 +Board [Kc Ac 5s 3h Qh] +Seat 1: EricSteph261 (big blind) folded on the River +Seat 3: supermeXXX folded on the River +Seat 5: s0rrow (button) folded before Flop (didn't bet) +Seat 6: tiger48475 (small blind) collected ($0.06) + + + +PokerStars Game #35875356253: Omaha Hi/Lo Pot Limit ($0.01/$0.02 USD) - 2009/11/26 10:47:00 ET +Table 'Gaby II' 6-max Seat #6 is the button +Seat 3: supermeXXX ($1.21 in chips) +Seat 5: s0rrow ($5.23 in chips) +Seat 6: tiger48475 ($5.06 in chips) +supermeXXX: posts small blind $0.01 +s0rrow: posts big blind $0.02 +*** HOLE CARDS *** +Dealt to s0rrow [8h Jd 5d 8d] +tiger48475: folds +supermeXXX: calls $0.01 +s0rrow: checks +*** FLOP *** [Ks 9s 6c] +supermeXXX: bets $0.02 +s0rrow: calls $0.02 +*** TURN *** [Ks 9s 6c] [Qc] +supermeXXX: bets $0.02 +s0rrow: calls $0.02 +*** RIVER *** [Ks 9s 6c Qc] [Ad] +supermeXXX: checks +s0rrow: checks +*** SHOW DOWN *** +supermeXXX: shows [Tc 7d 8c 3s] (HI: high card Ace) +s0rrow: shows [8h Jd 5d 8d] (HI: a pair of Eights) +s0rrow collected $0.12 from pot +No low hand qualified +*** SUMMARY *** +Total pot $0.12 | Rake $0 +Board [Ks 9s 6c Qc Ad] +Seat 3: supermeXXX (small blind) showed [Tc 7d 8c 3s] and lost with HI: high card Ace +Seat 5: s0rrow (big blind) showed [8h Jd 5d 8d] and won ($0.12) with HI: a pair of Eights +Seat 6: tiger48475 (button) folded before Flop (didn't bet) + + + +PokerStars Game #35875379792: Omaha Hi/Lo Pot Limit ($0.01/$0.02 USD) - 2009/11/26 10:47:39 ET +Table 'Gaby II' 6-max Seat #3 is the button +Seat 3: supermeXXX ($1.15 in chips) +Seat 5: s0rrow ($5.29 in chips) +Seat 6: tiger48475 ($5.06 in chips) +s0rrow: posts small blind $0.01 +tiger48475: posts big blind $0.02 +*** HOLE CARDS *** +Dealt to s0rrow [9c 5h 3s Th] +supermeXXX: calls $0.02 +s0rrow: calls $0.01 +tiger48475: checks +*** FLOP *** [Jc 3h Jd] +s0rrow: checks +tiger48475: checks +supermeXXX: checks +*** TURN *** [Jc 3h Jd] [6d] +s0rrow: checks +tiger48475: bets $0.06 +supermeXXX: folds +EricSteph261 has returned +s0rrow: calls $0.06 +*** RIVER *** [Jc 3h Jd 6d] [5c] +s0rrow: checks +tiger48475: bets $0.14 +s0rrow: folds +Uncalled bet ($0.14) returned to tiger48475 +tiger48475 collected $0.18 from pot +*** SUMMARY *** +Total pot $0.18 | Rake $0 +Board [Jc 3h Jd 6d 5c] +Seat 3: supermeXXX (button) folded on the Turn +Seat 5: s0rrow (small blind) folded on the River +Seat 6: tiger48475 (big blind) collected ($0.18) + + + +PokerStars Game #35875409365: Omaha Hi/Lo Pot Limit ($0.01/$0.02 USD) - 2009/11/26 10:48:29 ET +Table 'Gaby II' 6-max Seat #5 is the button +Seat 1: EricSteph261 ($11.28 in chips) +Seat 3: supermeXXX ($1.13 in chips) +Seat 5: s0rrow ($5.21 in chips) +Seat 6: tiger48475 ($5.16 in chips) +tiger48475: posts small blind $0.01 +EricSteph261: posts big blind $0.02 +*** HOLE CARDS *** +Dealt to s0rrow [6h 3c Th 2s] +supermeXXX: calls $0.02 +s0rrow: calls $0.02 +tiger48475: calls $0.01 +EricSteph261 has timed out +EricSteph261: checks +*** FLOP *** [9d 5s Jh] +tiger48475: bets $0.06 +EricSteph261 has timed out +EricSteph261: folds +EricSteph261 is sitting out +supermeXXX: calls $0.06 +s0rrow: calls $0.06 +*** TURN *** [9d 5s Jh] [Ks] +tiger48475: checks +supermeXXX: bets $0.10 +s0rrow: folds +tiger48475: calls $0.10 +*** RIVER *** [9d 5s Jh Ks] [9s] +tiger48475: checks +supermeXXX: checks +*** SHOW DOWN *** +tiger48475: shows [6s 9h 9c Ad] (HI: four of a kind, Nines) +supermeXXX: mucks hand +tiger48475 collected $0.46 from pot +No low hand qualified +*** SUMMARY *** +Total pot $0.46 | Rake $0 +Board [9d 5s Jh Ks 9s] +Seat 1: EricSteph261 (big blind) folded on the Flop +Seat 3: supermeXXX mucked [Qd Tc 5h Ts] +Seat 5: s0rrow (button) folded on the Turn +Seat 6: tiger48475 (small blind) showed [6s 9h 9c Ad] and won ($0.46) with HI: four of a kind, Nines + + + diff --git a/pyfpdb/regression-test-files/cash/Stars/Stud/7-StudHL-USD-0.04-0.08-200911.Cardtest.txt b/pyfpdb/regression-test-files/cash/Stars/Stud/7-StudHL-USD-0.04-0.08-200911.Cardtest.txt new file mode 100644 index 00000000..0ffdcc3d --- /dev/null +++ b/pyfpdb/regression-test-files/cash/Stars/Stud/7-StudHL-USD-0.04-0.08-200911.Cardtest.txt @@ -0,0 +1,96 @@ +PokerStars Game #35874676388: 7 Card Stud Hi/Lo Limit ($0.04/$0.08 USD) - 2009/11/26 10:27:46 ET +Table 'Dawn II' 8-max +Seat 1: u.pressure ($11.17 in chips) +Seat 2: 123smoothie ($0.99 in chips) +Seat 3: gashpor ($1.40 in chips) +Seat 4: denny501 ($0.71 in chips) +Seat 5: s0rrow ($1.52 in chips) +Seat 6: TomSludge ($1.58 in chips) +Seat 7: Soroka69 ($0.83 in chips) +Seat 8: rdiezchang ($2.05 in chips) +u.pressure: posts the ante $0.01 +123smoothie: posts the ante $0.01 +gashpor: posts the ante $0.01 +denny501: posts the ante $0.01 +s0rrow: posts the ante $0.01 +TomSludge: posts the ante $0.01 +Soroka69: posts the ante $0.01 +rdiezchang: posts the ante $0.01 +*** 3rd STREET *** +Dealt to u.pressure [Td] +Dealt to 123smoothie [4c] +Dealt to gashpor [5d] +Dealt to denny501 [2c] +Dealt to s0rrow [7c 3s 5h] +Dealt to TomSludge [8s] +Dealt to Soroka69 [7d] +Dealt to rdiezchang [Ad] +denny501: brings in for $0.02 +s0rrow: calls $0.02 +TomSludge: folds +Soroka69: calls $0.02 +rdiezchang: calls $0.02 +u.pressure: folds +123smoothie: calls $0.02 +gashpor: calls $0.02 +*** 4th STREET *** +Dealt to 123smoothie [4c] [3c] +Dealt to gashpor [5d] [Qd] +Dealt to denny501 [2c] [7s] +Dealt to s0rrow [7c 3s 5h] [Qc] +Dealt to Soroka69 [7d] [5s] +Dealt to rdiezchang [Ad] [Js] +rdiezchang: checks +123smoothie: checks +gashpor: checks +denny501: folds +denny501 leaves the table +s0rrow: checks +Soroka69: checks +*** 5th STREET *** +Dealt to 123smoothie [4c 3c] [9s] +Dealt to gashpor [5d Qd] [Jd] +Dealt to s0rrow [7c 3s 5h Qc] [Kc] +Dealt to Soroka69 [7d 5s] [5c] +Dealt to rdiezchang [Ad Js] [Ts] +LainaRahat joins the table at seat #4 +Soroka69: checks +rdiezchang: checks +123smoothie: checks +gashpor: bets $0.08 +s0rrow: calls $0.08 +Soroka69: calls $0.08 +rdiezchang: folds +123smoothie: folds +*** 6th STREET *** +Dealt to gashpor [5d Qd Jd] [9d] +Dealt to s0rrow [7c 3s 5h Qc Kc] [6d] +Dealt to Soroka69 [7d 5s 5c] [2s] +Soroka69: checks +gashpor: bets $0.08 +s0rrow: calls $0.08 +Soroka69: calls $0.08 +*** RIVER *** +Dealt to s0rrow [7c 3s 5h Qc Kc 6d] [4d] +Soroka69: checks +gashpor: bets $0.08 +s0rrow: calls $0.08 +Soroka69: folds +*** SHOW DOWN *** +gashpor: shows [4h 3d 5d Qd Jd 9d 6h] (HI: a flush, Queen high) +s0rrow: shows [7c 3s 5h Qc Kc 6d 4d] (HI: a straight, Three to Seven; LO: 7,6,5,4,3) +gashpor collected $0.40 from pot +s0rrow collected $0.40 from pot +*** SUMMARY *** +Total pot $0.84 | Rake $0.04 +Seat 1: u.pressure folded on the 3rd Street (didn't bet) +Seat 2: 123smoothie folded on the 5th Street +Seat 3: gashpor showed [4h 3d 5d Qd Jd 9d 6h] and won ($0.40) with HI: a flush, Queen high +Seat 4: denny501 folded on the 4th Street +Seat 5: s0rrow showed [7c 3s 5h Qc Kc 6d 4d] and won ($0.40) with HI: a straight, Three to Seven; LO: 7,6,5,4,3 +Seat 6: TomSludge folded on the 3rd Street (didn't bet) +Seat 7: Soroka69 folded on the River +Seat 8: rdiezchang folded on the 5th Street + + + diff --git a/pyfpdb/test1.py b/pyfpdb/test1.py new file mode 100755 index 00000000..76bde20e --- /dev/null +++ b/pyfpdb/test1.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python +"""test1.py + +Test if python is working. +""" +# Copyright 2008, Ray E. Barker +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +######################################################################## + +import sys + +print "\npython is working!" +print "\npress return to finish" + +sys.stdin.readline() diff --git a/pyfpdb/test2.py b/pyfpdb/test2.py new file mode 100755 index 00000000..c52d0a6c --- /dev/null +++ b/pyfpdb/test2.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python +"""test2.py + +Test if gtk is working. +""" +# Copyright 2008, Ray E. Barker +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +######################################################################## + +import sys + +try: + import pygtk + pygtk.require('2.0') + import gtk + + + win = gtk.Window(gtk.WINDOW_TOPLEVEL) + win.set_title("Test GTK") + win.set_border_width(1) + win.set_default_size(600, 500) + win.set_resizable(True) + #win.show() + + dia = gtk.Dialog("Test GTK", + win, + gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, + (gtk.STOCK_CLOSE, gtk.RESPONSE_OK)) + dia.set_default_size(500, 300) + + l = gtk.Label("GTK is working!") + dia.vbox.add(l) + l.show() + + response = dia.run() + if response == gtk.RESPONSE_ACCEPT: + pass + dia.destroy() + +except: + print "\nError:", sys.exc_info() + print "\npress return to finish" + sys.stdin.readline() diff --git a/pyfpdb/test_PokerStars.py b/pyfpdb/test_PokerStars.py index f7959134..e3e45c35 100644 --- a/pyfpdb/test_PokerStars.py +++ b/pyfpdb/test_PokerStars.py @@ -87,19 +87,12 @@ def testFlopImport(): print "DEBUG: stored: %s dups: %s partial: %s errs: %s ttime: %s" %(stored, dups, partial, errs, ttime) importer.clearFileList() + col = { 'sawShowdown': 2 + } + q = """SELECT s.name, - g.category, - g.base, - g.type, - g.limitType, - g.hilo, - round(g.smallBlind / 100.0,2) as sb, - round(g.bigBlind / 100.0,2) as bb, - round(g.smallBet / 100.0,2) as SB, - round(g.bigBet / 100.0,2) as BB, - s.currency, - hp.playerId, + p.name, hp.sawShowdown FROM Hands as h, @@ -116,10 +109,10 @@ and s.id = p.siteid""" c = db.get_cursor() c.execute(q) result = c.fetchall() - print "DEBUG: result: %s" %result - - - assert 1 == 0 + for row, data in enumerate(result): + print "DEBUG: result[%s]: %s" %(row, result[row]) + # Assert if any sawShowdown = True + assert result[row][col['sawShowdown']] == 0 def testStudImport(): db.recreate_tables()