From 46f246e27dc89943bf4033e3fe58bed2f450c9c2 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 12 Mar 2009 17:51:29 -0400 Subject: [PATCH 01/18] Change a rogue xrange back to range. --- pyfpdb/Hud.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pyfpdb/Hud.py b/pyfpdb/Hud.py index 07396f61..54cc6b35 100644 --- a/pyfpdb/Hud.py +++ b/pyfpdb/Hud.py @@ -218,8 +218,9 @@ class Hud: self.config.save() def adj_seats(self, hand, config): - - adj = xrange(0, self.max + 1) # default seat adjustments = no adjustment + +# Need range here, not xrange -> need the actual list + adj = range(0, self.max + 1) # default seat adjustments = no adjustment # does the user have a fav_seat? try: sys.stderr.write("site = %s, max = %d, fav seat = %d\n" % (self.table.site, self.max, config.supported_sites[self.table.site].layout[self.max].fav_seat)) From f0413a66f55a88dab2045c83608d44081a669b57 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 12 Mar 2009 17:58:12 -0400 Subject: [PATCH 02/18] Fix moved method, but didn't change reference. --- pyfpdb/Mucked.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyfpdb/Mucked.py b/pyfpdb/Mucked.py index 06a216b3..90af4b8f 100755 --- a/pyfpdb/Mucked.py +++ b/pyfpdb/Mucked.py @@ -215,7 +215,7 @@ class Stud_cards: self.config = config # self.db_name = db_name - self.card_images = self.get_card_images() + self.card_images = self.parent.get_card_images() self.seen_cards = {} self.grid_contents = {} self.eb = {} @@ -280,7 +280,7 @@ class Stud_cards: (4, cards[8:10]), (5, cards[10:12]), (6, cards[12:14])): if not i[1] == "xx": self.seen_cards[(i[0], c - 1)]. \ - set_from_pixbuf(self.card_images[self.split_cards(i[1])]) + set_from_pixbuf(self.card_images[self.parent.split_cards(i[1])]) ## action in tool tips for 3rd street cards for c in (0, 1, 2): for r in range(0, self.rows): From 771a95fe32e5cdc813ef6650173575253d20aa63 Mon Sep 17 00:00:00 2001 From: Matt Turnbull Date: Fri, 13 Mar 2009 16:45:32 +0000 Subject: [PATCH 03/18] if holecards can be infered from summary line, indicate that they were 'shown' so that they can be output in summary line --- pyfpdb/Hand.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pyfpdb/Hand.py b/pyfpdb/Hand.py index d91450be..6e7628a4 100644 --- a/pyfpdb/Hand.py +++ b/pyfpdb/Hand.py @@ -406,7 +406,7 @@ class HoldemOmahaHand(Hand): self.totalPot() # finalise it (total the pot) hhc.getRake(self) - def addHoleCards(self, cards, player): + def addHoleCards(self, cards, player, shown=False): """\ Assigns observed holecards to a player. cards list of card bigrams e.g. ['2h','Jc'] @@ -416,6 +416,8 @@ player (string) name of player try: self.checkPlayerExists(player) cardset = set(self.card(c) for c in cards) + if shown and len(cardset) > 0: + self.shown.add(player) if 'PREFLOP' in self.holecards[player]: self.holecards[player]['PREFLOP'].update(cardset) else: @@ -435,7 +437,7 @@ Card ranks will be uppercased elif holeandboard is not None: holeandboard = set([self.card(c) for c in holeandboard]) board = set([c for s in self.board.values() for c in s]) - self.addHoleCards(holeandboard.difference(board),player) + self.addHoleCards(holeandboard.difference(board),player,shown=True) def writeHand(self, fh=sys.__stdout__): From 21376c0b6289f6ca287c9e2164af3e3fa673f469 Mon Sep 17 00:00:00 2001 From: Matt Turnbull Date: Fri, 13 Mar 2009 16:50:46 +0000 Subject: [PATCH 04/18] slight change in logic, I hope the this is right: if win & show : player showed [x] and won $ elif win: player won $ elif folded: player folded else: if shown: player showed [x] and lost... else: player mucked --- pyfpdb/Hand.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pyfpdb/Hand.py b/pyfpdb/Hand.py index 6e7628a4..d5912f60 100644 --- a/pyfpdb/Hand.py +++ b/pyfpdb/Hand.py @@ -534,12 +534,15 @@ Card ranks will be uppercased print >>fh, _("Seat %d: %s showed [%s] and won ($%s)" % (seatnum, name, " ".join(self.holecards[name]['PREFLOP']), self.collectees[name])) elif name in self.collectees: print >>fh, _("Seat %d: %s collected ($%s)" % (seatnum, name, self.collectees[name])) - elif name in self.shown: - print >>fh, _("Seat %d: %s showed [%s]" % (seatnum, name, " ".join(self.holecards[name]['PREFLOP']))) + #~ elif name in self.shown: + #~ print >>fh, _("Seat %d: %s showed [%s]" % (seatnum, name, " ".join(self.holecards[name]['PREFLOP']))) elif name in self.folded: print >>fh, _("Seat %d: %s folded" % (seatnum, name)) else: - print >>fh, _("Seat %d: %s mucked" % (seatnum, name)) + if name in self.shown: + print >>fh, _("Seat %d: %s showed [%s] and lost with..." % (seatnum, name, " ".join(self.holecards[name]['PREFLOP']))) + else: + print >>fh, _("Seat %d: %s mucked" % (seatnum, name)) print >>fh, "\n\n" From d3103f099e7a0abd982cb5e6f1e11f4eb46eac76 Mon Sep 17 00:00:00 2001 From: Worros Date: Sat, 14 Mar 2009 06:42:20 +0900 Subject: [PATCH 05/18] Make Stars Badugi recognised --- pyfpdb/PokerStarsToFpdb.py | 5 +++-- pyfpdb/test_FullTilt.py | 2 +- pyfpdb/test_PokerStars.py | 5 ++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pyfpdb/PokerStarsToFpdb.py b/pyfpdb/PokerStarsToFpdb.py index 05027121..8c2e4884 100755 --- a/pyfpdb/PokerStarsToFpdb.py +++ b/pyfpdb/PokerStarsToFpdb.py @@ -69,7 +69,7 @@ from HandHistoryConverter import * class PokerStars(HandHistoryConverter): # Static regexes - re_GameInfo = re.compile('PokerStars Game #(?P[0-9]+):\s+(HORSE)? \(?(?PHold\'em|Razz|7 Card Stud|Omaha Hi/Lo) (?PNo Limit|Limit|Pot Limit),? \(?(?P\$|)?(?P[.0-9]+)/\$?(?P[.0-9]+)\) - (?P.*$)', re.MULTILINE) + re_GameInfo = re.compile("PokerStars Game #(?P[0-9]+):\s+(HORSE)? \(?(?PHold\'em|Razz|7 Card Stud|Omaha Hi/Lo|Badugi) (?PNo Limit|Limit|Pot Limit),? \(?(?P\$|)?(?P[.0-9]+)/\$?(?P[.0-9]+)\) - (?P.*$)", re.MULTILINE) re_SplitHands = re.compile('\n\n+') re_HandInfo = re.compile("^Table \'(?P[- a-zA-Z]+)\'(?P.+?$)?", re.MULTILINE) re_Button = re.compile('Seat #(?P