From 00f98f0e12e83e666a39d393276b299338bbfb9f Mon Sep 17 00:00:00 2001 From: Scott Wolchok Date: Wed, 23 Feb 2011 23:28:37 -0500 Subject: [PATCH 01/17] Hand.py: Use str.replace instead of re.sub for stripping commas. --- pyfpdb/Hand.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pyfpdb/Hand.py b/pyfpdb/Hand.py index 1e3642aa..0bd08470 100644 --- a/pyfpdb/Hand.py +++ b/pyfpdb/Hand.py @@ -445,7 +445,7 @@ chips (string) the chips the player has at the start of the hand (can be None) If a player has None chips he won't be added.""" log.debug("addPlayer: %s %s (%s)" % (seat, name, chips)) if chips is not None: - chips = re.sub(u',', u'', chips) #some sites have commas + chips = chips.replace(u',', u'') #some sites have commas self.players.append([seat, name, chips]) self.stacks[name] = Decimal(chips) self.pot.addPlayer(name) @@ -487,7 +487,7 @@ If a player has None chips he won't be added.""" For sites (currently only Carbon Poker) which record "all in" as a special action, which can mean either "calls and is all in" or "raises all in". """ self.checkPlayerExists(player) - amount = re.sub(u',', u'', amount) #some sites have commas + amount = amount.replace(u',', u'') #some sites have commas Ai = Decimal(amount) Bp = self.lastBet[street] Bc = reduce(operator.add, self.bets[street][player], 0) @@ -503,7 +503,7 @@ For sites (currently only Carbon Poker) which record "all in" as a special actio def addAnte(self, player, ante): log.debug("%s %s antes %s" % ('BLINDSANTES', player, ante)) if player is not None: - ante = re.sub(u',', u'', ante) #some sites have commas + ante = ante.replace(u',', u'') #some sites have commas self.bets['BLINDSANTES'][player].append(Decimal(ante)) self.stacks[player] -= Decimal(ante) act = (player, 'ante', Decimal(ante), self.stacks[player]==0) @@ -522,7 +522,7 @@ For sites (currently only Carbon Poker) which record "all in" as a special actio # log.debug("addBlind: %s posts %s, %s" % (player, blindtype, amount)) if player is not None: - amount = re.sub(u',', u'', amount) #some sites have commas + amount = amount.replace(u',', u'') #some sites have commas self.stacks[player] -= Decimal(amount) act = (player, blindtype, Decimal(amount), self.stacks[player]==0) self.actions['BLINDSANTES'].append(act) @@ -555,7 +555,7 @@ For sites (currently only Carbon Poker) which record "all in" as a special actio def addCall(self, street, player=None, amount=None): if amount: - amount = re.sub(u',', u'', amount) #some sites have commas + amount = amount.replace(u',', u'') #some sites have commas log.debug(_("%s %s calls %s") %(street, player, amount)) # Potentially calculate the amount of the call if not supplied # corner cases include if player would be all in @@ -583,7 +583,7 @@ Add a raise by amountBy on [street] by [player] # then: C = Bp - Bc (amount to call) # Rt = Bp + Rb (raise to) # - amountBy = re.sub(u',', u'', amountBy) #some sites have commas + amountBy = amountBy.replace(u',', u'') #some sites have commas self.checkPlayerExists(player) Rb = Decimal(amountBy) Bp = self.lastBet[street] @@ -601,7 +601,7 @@ Add a raise by amountBy on [street] by [player] """\ For sites which by "raises x" mean "calls and raises putting a total of x in the por". """ self.checkPlayerExists(player) - amount = re.sub(u',', u'', amount) #some sites have commas + amount = amount.replace(u',', u'') #some sites have commas CRb = Decimal(amount) Bp = self.lastBet[street] Bc = reduce(operator.add, self.bets[street][player], 0) @@ -617,7 +617,7 @@ Add a raise on [street] by [player] to [amountTo] """ #CG - No idea if this function has been test/verified self.checkPlayerExists(player) - amountTo = re.sub(u',', u'', amountTo) #some sites have commas + amountTo = amountTo.replace(u',', u'') #some sites have commas Bp = self.lastBet[street] Bc = reduce(operator.add, self.bets[street][player], 0) Rt = Decimal(amountTo) @@ -638,7 +638,7 @@ Add a raise on [street] by [player] to [amountTo] def addBet(self, street, player, amount): log.debug(_("%s %s bets %s") %(street, player, amount)) - amount = re.sub(u',', u'', amount) #some sites have commas + amount = amount.replace(u',', u'') #some sites have commas self.checkPlayerExists(player) self.bets[street][player].append(Decimal(amount)) self.stacks[player] -= Decimal(amount) @@ -1377,7 +1377,7 @@ closed likewise, but known only to player Add a complete on [street] by [player] to [amountTo] """ log.debug(_("%s %s completes %s") % (street, player, amountTo)) - amountTo = re.sub(u',', u'', amountTo) #some sites have commas + amountTo = amountTo.replace(u',', u'') #some sites have commas self.checkPlayerExists(player) Bp = self.lastBet['THIRD'] Bc = reduce(operator.add, self.bets[street][player], 0) From 1227c5df740780aed446739577255f8aeb48e927 Mon Sep 17 00:00:00 2001 From: Scott Wolchok Date: Wed, 23 Feb 2011 23:31:46 -0500 Subject: [PATCH 02/17] Hand.py: Use sum(x) instead of reduce(operator.add, x, 0). --- pyfpdb/Hand.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pyfpdb/Hand.py b/pyfpdb/Hand.py index 0bd08470..50886a9e 100644 --- a/pyfpdb/Hand.py +++ b/pyfpdb/Hand.py @@ -490,7 +490,7 @@ For sites (currently only Carbon Poker) which record "all in" as a special actio amount = amount.replace(u',', u'') #some sites have commas Ai = Decimal(amount) Bp = self.lastBet[street] - Bc = reduce(operator.add, self.bets[street][player], 0) + Bc = sum(self.bets[street][player]) C = Bp - Bc if Ai <= C: self.addCall(street, player, amount) @@ -587,7 +587,7 @@ Add a raise by amountBy on [street] by [player] self.checkPlayerExists(player) Rb = Decimal(amountBy) Bp = self.lastBet[street] - Bc = reduce(operator.add, self.bets[street][player], 0) + Bc = sum(self.bets[street][player]) C = Bp - Bc Rt = Bp + Rb @@ -604,7 +604,7 @@ For sites which by "raises x" mean "calls and raises putting a total of x in the amount = amount.replace(u',', u'') #some sites have commas CRb = Decimal(amount) Bp = self.lastBet[street] - Bc = reduce(operator.add, self.bets[street][player], 0) + Bc = sum(self.bets[street][player]) C = Bp - Bc Rb = CRb - C Rt = Bp + Rb @@ -619,7 +619,7 @@ Add a raise on [street] by [player] to [amountTo] self.checkPlayerExists(player) amountTo = amountTo.replace(u',', u'') #some sites have commas Bp = self.lastBet[street] - Bc = reduce(operator.add, self.bets[street][player], 0) + Bc = sum(self.bets[street][player]) Rt = Decimal(amountTo) C = Bp - Bc Rb = Rt - C - Bc @@ -1380,7 +1380,7 @@ Add a complete on [street] by [player] to [amountTo] amountTo = amountTo.replace(u',', u'') #some sites have commas self.checkPlayerExists(player) Bp = self.lastBet['THIRD'] - Bc = reduce(operator.add, self.bets[street][player], 0) + Bc = sum(self.bets[street][player]) Rt = Decimal(amountTo) C = Bp - Bc Rb = Rt - C From cdf158cfae08ab33f98a6c1abacf4f6d7d8cd79c Mon Sep 17 00:00:00 2001 From: Scott Wolchok Date: Wed, 23 Feb 2011 23:41:14 -0500 Subject: [PATCH 03/17] Hand.py: Call Decimal ctor a lot less. --- pyfpdb/Hand.py | 67 ++++++++++++++++++++++++++++---------------------- 1 file changed, 37 insertions(+), 30 deletions(-) diff --git a/pyfpdb/Hand.py b/pyfpdb/Hand.py index 50886a9e..6e642c20 100644 --- a/pyfpdb/Hand.py +++ b/pyfpdb/Hand.py @@ -504,12 +504,13 @@ For sites (currently only Carbon Poker) which record "all in" as a special actio log.debug("%s %s antes %s" % ('BLINDSANTES', player, ante)) if player is not None: ante = ante.replace(u',', u'') #some sites have commas - self.bets['BLINDSANTES'][player].append(Decimal(ante)) - self.stacks[player] -= Decimal(ante) - act = (player, 'ante', Decimal(ante), self.stacks[player]==0) + ante = Decimal(ante) + self.bets['BLINDSANTES'][player].append(ante) + self.stacks[player] -= ante + act = (player, 'ante', ante, self.stacks[player]==0) self.actions['BLINDSANTES'].append(act) -# self.pot.addMoney(player, Decimal(ante)) - self.pot.addCommonMoney(player, Decimal(ante)) +# self.pot.addMoney(player, ante) + self.pot.addCommonMoney(player, ante) #I think the antes should be common money, don't have enough hand history to check def addBlind(self, player, blindtype, amount): @@ -523,21 +524,24 @@ For sites (currently only Carbon Poker) which record "all in" as a special actio log.debug("addBlind: %s posts %s, %s" % (player, blindtype, amount)) if player is not None: amount = amount.replace(u',', u'') #some sites have commas - self.stacks[player] -= Decimal(amount) - act = (player, blindtype, Decimal(amount), self.stacks[player]==0) + amount = Decimal(amount) + self.stacks[player] -= amount + act = (player, blindtype, amount, self.stacks[player]==0) self.actions['BLINDSANTES'].append(act) if blindtype == 'both': # work with the real amount. limit games are listed as $1, $2, where # the SB 0.50 and the BB is $1, after the turn the minimum bet amount is $2.... - amount = self.bb - self.bets['BLINDSANTES'][player].append(Decimal(self.sb)) - self.pot.addCommonMoney(player, Decimal(self.sb)) + amount = Decimal(self.bb) + sb = Decimal(self.sb) + self.bets['BLINDSANTES'][player].append(sb) + self.pot.addCommonMoney(player, sb) if blindtype == 'secondsb': amount = Decimal(0) - self.bets['BLINDSANTES'][player].append(Decimal(self.sb)) - self.pot.addCommonMoney(player, Decimal(self.sb)) + sb = Decimal(self.sb) + self.bets['BLINDSANTES'][player].append(sb) + self.pot.addCommonMoney(player, sb) street = 'BLAH' @@ -546,9 +550,9 @@ For sites (currently only Carbon Poker) which record "all in" as a special actio elif self.gametype['base'] == 'draw': street = 'DEAL' - self.bets[street][player].append(Decimal(amount)) - self.pot.addMoney(player, Decimal(amount)) - self.lastBet[street] = Decimal(amount) + self.bets[street][player].append(amount) + self.pot.addMoney(player, amount) + self.lastBet[street] = amount self.posted = self.posted + [[player,blindtype]] @@ -560,13 +564,14 @@ For sites (currently only Carbon Poker) which record "all in" as a special actio # Potentially calculate the amount of the call if not supplied # corner cases include if player would be all in if amount is not None: - self.bets[street][player].append(Decimal(amount)) - #self.lastBet[street] = Decimal(amount) - self.stacks[player] -= Decimal(amount) + amount = Decimal(amount) + self.bets[street][player].append(amount) + #self.lastBet[street] = amount + self.stacks[player] -= amount #print "DEBUG %s calls %s, stack %s" % (player, amount, self.stacks[player]) - act = (player, 'calls', Decimal(amount), self.stacks[player]==0) + act = (player, 'calls', amount, self.stacks[player] == 0) self.actions[street].append(act) - self.pot.addMoney(player, Decimal(amount)) + self.pot.addMoney(player, amount) def addRaiseBy(self, street, player, amountBy): """\ @@ -639,14 +644,15 @@ Add a raise on [street] by [player] to [amountTo] def addBet(self, street, player, amount): log.debug(_("%s %s bets %s") %(street, player, amount)) amount = amount.replace(u',', u'') #some sites have commas + amount = Decimal(amount) self.checkPlayerExists(player) - self.bets[street][player].append(Decimal(amount)) - self.stacks[player] -= Decimal(amount) + self.bets[street][player].append(amount) + self.stacks[player] -= amount #print "DEBUG %s bets %s, stack %s" % (player, amount, self.stacks[player]) - act = (player, 'bets', Decimal(amount), self.stacks[player]==0) + act = (player, 'bets', amount, self.stacks[player]==0) self.actions[street].append(act) - self.lastBet[street] = Decimal(amount) - self.pot.addMoney(player, Decimal(amount)) + self.lastBet[street] = amount + self.pot.addMoney(player, amount) def addStandsPat(self, street, player): @@ -1395,12 +1401,13 @@ Add a complete on [street] by [player] to [amountTo] def addBringIn(self, player, bringin): if player is not None: log.debug(_("Bringin: %s, %s") % (player , bringin)) - self.bets['THIRD'][player].append(Decimal(bringin)) - self.stacks[player] -= Decimal(bringin) - act = (player, 'bringin', Decimal(bringin), self.stacks[player]==0) + bringin = Decimal(bringin) + self.bets['THIRD'][player].append(bringin) + self.stacks[player] -= bringin + act = (player, 'bringin', bringin, self.stacks[player]==0) self.actions['THIRD'].append(act) - self.lastBet['THIRD'] = Decimal(bringin) - self.pot.addMoney(player, Decimal(bringin)) + self.lastBet['THIRD'] = bringin + self.pot.addMoney(player, bringin) def getStreetTotals(self): # street1Pot INT, /* pot size at flop/street4 */ From bf417f05695fe5bfd123568039edc74f2dcdcf5d Mon Sep 17 00:00:00 2001 From: Scott Wolchok Date: Thu, 24 Feb 2011 00:27:43 -0500 Subject: [PATCH 04/17] Filters.py: Fix broken show/hide button for Graphing Options. --- pyfpdb/Filters.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pyfpdb/Filters.py b/pyfpdb/Filters.py index 557bb846..632f71ab 100644 --- a/pyfpdb/Filters.py +++ b/pyfpdb/Filters.py @@ -829,11 +829,16 @@ class Filters(threading.Thread): top_hbox.pack_start(title, expand=True, padding=3) showb = gtk.Button(label="hide", stock=None, use_underline=True) showb.set_alignment(xalign=1.0, yalign=0.5) - showb.connect('clicked', self.__toggle_box, 'games') + showb.connect('clicked', self.__toggle_box, 'graphops') top_hbox.pack_start(showb, expand=False, padding=1) + vbox1 = gtk.VBox(False, 0) + vbox.pack_start(vbox1, False, False, 0) + vbox1.show() + self.boxes['graphops'] = vbox1 + hbox1 = gtk.HBox(False, 0) - vbox.pack_start(hbox1, False, False, 0) + vbox1.pack_start(hbox1, False, False, 0) hbox1.show() label = gtk.Label(_("Show Graph In:")) @@ -852,10 +857,6 @@ class Filters(threading.Thread): button.connect("toggled", self.__set_displayin_select, "BB") button.show() - vbox1 = gtk.VBox(False, 0) - vbox.pack_start(vbox1, False, False, 0) - vbox1.show() - button = gtk.CheckButton(_("Showdown Winnings"), False) vbox1.pack_start(button, True, True, 0) # wouldn't it be awesome if there was a way to remember the state of things like From 1f86ca0d40163a9b587613ed8479fd423fd13a07 Mon Sep 17 00:00:00 2001 From: Erki Ferenc Date: Thu, 24 Feb 2011 12:09:18 +0100 Subject: [PATCH 05/17] l10n: updated Hungarian translation --- pyfpdb/locale/fpdb-hu_HU.po | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/pyfpdb/locale/fpdb-hu_HU.po b/pyfpdb/locale/fpdb-hu_HU.po index 1661f8f2..49bf53b5 100644 --- a/pyfpdb/locale/fpdb-hu_HU.po +++ b/pyfpdb/locale/fpdb-hu_HU.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.20.905 plus git\n" "POT-Creation-Date: 2011-02-23 16:58+CET\n" -"PO-Revision-Date: 2011-02-20 21:27+0100\n" +"PO-Revision-Date: 2011-02-24 12:08+0100\n" "Last-Translator: Ferenc Erki \n" "Language-Team: Hungarian \n" "Language: hu\n" @@ -654,7 +654,7 @@ msgstr "Versenyek" #: Filters.py:80 msgid "DEBUG: New packing box created!" -msgstr "" +msgstr "DEBUG: Új csoportosító doboz létrehozva!" #: Filters.py:106 TourneyFilters.py:114 msgid "Either 0 or more than one site matched (%s) - EEK" @@ -714,20 +714,19 @@ msgstr "Nem található játék az adatbázisban" #: Filters.py:827 msgid "Graphing Options:" -msgstr "" +msgstr "Grafikon opciók:" #: Filters.py:839 msgid "Show Graph In:" -msgstr "" +msgstr "Profit:" #: Filters.py:859 msgid "Showdown Winnings" -msgstr "" +msgstr "Nyeremény mutatással" #: Filters.py:867 -#, fuzzy msgid "Non-Showdown Winnings" -msgstr "Mutatás nélkül: $%.2f" +msgstr "Nyeremény mutatás nélkül" #: Filters.py:984 msgid "From:" @@ -842,9 +841,8 @@ msgid " Start _Auto Import " msgstr " _Auto Import indítása " #: GuiAutoImport.py:125 -#, fuzzy msgid "Detect Directories" -msgstr "'%s' könyvtár létrehozva" +msgstr "Könyvtárak felismerése" #: GuiAutoImport.py:144 msgid "Auto Import Ready." @@ -3117,10 +3115,11 @@ msgstr "Nem sikerült az utcák hozzáadása. handtext=%s" #: XTables.py:70 msgid "Could not retrieve XID from table xwininfo. xwininfo is %s" msgstr "" +"Nem sikerült az XID meghatározása az asztal xwininfo-jából. Az xwininfo: %s" #: XTables.py:74 msgid "No match in XTables for table '%s'." -msgstr "" +msgstr "Nincs találat az XTables-ben ehhez az asztalhoz: '%s'" #: fpdb.pyw:38 msgid " - press return to continue\n" From f006b7c2535578ee0a86612d46d4044a615920e8 Mon Sep 17 00:00:00 2001 From: Worros Date: Fri, 25 Feb 2011 13:05:39 +0800 Subject: [PATCH 06/17] Hand.py: Use sum(x) instead of reduce(operator.add, x, 0) From: Scott Wolchok Make the code slightly more readable --- pyfpdb/Hand.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pyfpdb/Hand.py b/pyfpdb/Hand.py index db6b0620..6e642c20 100644 --- a/pyfpdb/Hand.py +++ b/pyfpdb/Hand.py @@ -490,7 +490,7 @@ For sites (currently only Carbon Poker) which record "all in" as a special actio amount = amount.replace(u',', u'') #some sites have commas Ai = Decimal(amount) Bp = self.lastBet[street] - Bc = reduce(operator.add, self.bets[street][player], 0) + Bc = sum(self.bets[street][player]) C = Bp - Bc if Ai <= C: self.addCall(street, player, amount) @@ -592,7 +592,7 @@ Add a raise by amountBy on [street] by [player] self.checkPlayerExists(player) Rb = Decimal(amountBy) Bp = self.lastBet[street] - Bc = reduce(operator.add, self.bets[street][player], 0) + Bc = sum(self.bets[street][player]) C = Bp - Bc Rt = Bp + Rb @@ -609,7 +609,7 @@ For sites which by "raises x" mean "calls and raises putting a total of x in the amount = amount.replace(u',', u'') #some sites have commas CRb = Decimal(amount) Bp = self.lastBet[street] - Bc = reduce(operator.add, self.bets[street][player], 0) + Bc = sum(self.bets[street][player]) C = Bp - Bc Rb = CRb - C Rt = Bp + Rb @@ -624,7 +624,7 @@ Add a raise on [street] by [player] to [amountTo] self.checkPlayerExists(player) amountTo = amountTo.replace(u',', u'') #some sites have commas Bp = self.lastBet[street] - Bc = reduce(operator.add, self.bets[street][player], 0) + Bc = sum(self.bets[street][player]) Rt = Decimal(amountTo) C = Bp - Bc Rb = Rt - C - Bc @@ -1386,7 +1386,7 @@ Add a complete on [street] by [player] to [amountTo] amountTo = amountTo.replace(u',', u'') #some sites have commas self.checkPlayerExists(player) Bp = self.lastBet['THIRD'] - Bc = reduce(operator.add, self.bets[street][player], 0) + Bc = sum(self.bets[street][player]) Rt = Decimal(amountTo) C = Bp - Bc Rb = Rt - C From f64c28b1b46855236fbae41fae4644e55087b681 Mon Sep 17 00:00:00 2001 From: Scott Wolchok Date: Fri, 25 Feb 2011 03:10:29 -0500 Subject: [PATCH 07/17] small wrapper to use cdecimal library if available. --- pyfpdb/decimal.py | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 pyfpdb/decimal.py diff --git a/pyfpdb/decimal.py b/pyfpdb/decimal.py new file mode 100644 index 00000000..e5202d92 --- /dev/null +++ b/pyfpdb/decimal.py @@ -0,0 +1,4 @@ +try: + from cdecimal import * +except ImportError: + from decimal import * From 6e3abbbb0a6dcd4738900617a61f53d3fbb8a65b Mon Sep 17 00:00:00 2001 From: Scott Wolchok Date: Fri, 25 Feb 2011 03:41:42 -0500 Subject: [PATCH 08/17] DerivedStats: build init dict for player stats only once. --- pyfpdb/DerivedStats.py | 129 +++++++++++++++++++++-------------------- 1 file changed, 67 insertions(+), 62 deletions(-) diff --git a/pyfpdb/DerivedStats.py b/pyfpdb/DerivedStats.py index 654e6001..93c09571 100644 --- a/pyfpdb/DerivedStats.py +++ b/pyfpdb/DerivedStats.py @@ -30,71 +30,76 @@ class DerivedStats(): self.hands = {} self.handsplayers = {} self.handsactions = {} + self._initStats = DerivedStats._buildStatsInitializer() + + @staticmethod + def _buildStatsInitializer(): + init = {} + #Init vars that may not be used, but still need to be inserted. + # All stud street4 need this when importing holdem + init['winnings'] = 0 + init['rake'] = 0 + init['totalProfit'] = 0 + init['street4Aggr'] = False + init['wonWhenSeenStreet1'] = 0.0 + init['sawShowdown'] = False + init['wonAtSD'] = 0.0 + init['startCards'] = 0 + init['position'] = 2 + init['street0_3BChance'] = False + init['street0_3BDone'] = False + init['street0_4BChance'] = False + init['street0_4BDone'] = False + init['street0_C4BChance'] = False + init['street0_C4BDone'] = False + init['street0_FoldTo3BChance']= False + init['street0_FoldTo3BDone']= False + init['street0_FoldTo4BChance']= False + init['street0_FoldTo4BDone']= False + init['street0_SqueezeChance']= False + init['street0_SqueezeDone'] = False + init['success_Steal'] = False + init['raiseFirstInChance'] = False + init['raisedFirstIn'] = False + init['foldBbToStealChance'] = False + init['foldSbToStealChance'] = False + init['foldedSbToSteal'] = False + init['foldedBbToSteal'] = False + init['tourneyTypeId'] = None + init['street1Seen'] = False + init['street2Seen'] = False + init['street3Seen'] = False + init['street4Seen'] = False + + + for i in range(5): + init['street%dCalls' % i] = 0 + init['street%dBets' % i] = 0 + init['street%dRaises' % i] = 0 + for i in range(1,5): + init['street%dCBChance' %i] = False + init['street%dCBDone' %i] = False + init['street%dCheckCallRaiseChance' %i] = False + init['street%dCheckCallRaiseDone' %i] = False + init['otherRaisedStreet%d' %i] = False + init['foldToOtherRaisedStreet%d' %i] = False + + #FIXME - Everything below this point is incomplete. + init['other3BStreet0'] = False + init['other4BStreet0'] = False + init['otherRaisedStreet0'] = False + init['foldToOtherRaisedStreet0'] = False + for i in range(1,5): + init['foldToStreet%dCBChance' %i] = False + init['foldToStreet%dCBDone' %i] = False + init['wonWhenSeenStreet2'] = 0.0 + init['wonWhenSeenStreet3'] = 0.0 + init['wonWhenSeenStreet4'] = 0.0 + return init def getStats(self, hand): - for player in hand.players: - self.handsplayers[player[1]] = {} - #Init vars that may not be used, but still need to be inserted. - # All stud street4 need this when importing holdem - self.handsplayers[player[1]]['winnings'] = 0 - self.handsplayers[player[1]]['rake'] = 0 - self.handsplayers[player[1]]['totalProfit'] = 0 - self.handsplayers[player[1]]['street4Aggr'] = False - self.handsplayers[player[1]]['wonWhenSeenStreet1'] = 0.0 - self.handsplayers[player[1]]['sawShowdown'] = False - self.handsplayers[player[1]]['wonAtSD'] = 0.0 - self.handsplayers[player[1]]['startCards'] = 0 - self.handsplayers[player[1]]['position'] = 2 - self.handsplayers[player[1]]['street0_3BChance'] = False - self.handsplayers[player[1]]['street0_3BDone'] = False - self.handsplayers[player[1]]['street0_4BChance'] = False - self.handsplayers[player[1]]['street0_4BDone'] = False - self.handsplayers[player[1]]['street0_C4BChance'] = False - self.handsplayers[player[1]]['street0_C4BDone'] = False - self.handsplayers[player[1]]['street0_FoldTo3BChance']= False - self.handsplayers[player[1]]['street0_FoldTo3BDone']= False - self.handsplayers[player[1]]['street0_FoldTo4BChance']= False - self.handsplayers[player[1]]['street0_FoldTo4BDone']= False - self.handsplayers[player[1]]['street0_SqueezeChance']= False - self.handsplayers[player[1]]['street0_SqueezeDone'] = False - self.handsplayers[player[1]]['success_Steal'] = False - self.handsplayers[player[1]]['raiseFirstInChance'] = False - self.handsplayers[player[1]]['raisedFirstIn'] = False - self.handsplayers[player[1]]['foldBbToStealChance'] = False - self.handsplayers[player[1]]['foldSbToStealChance'] = False - self.handsplayers[player[1]]['foldedSbToSteal'] = False - self.handsplayers[player[1]]['foldedBbToSteal'] = False - self.handsplayers[player[1]]['tourneyTypeId'] = None - self.handsplayers[player[1]]['street1Seen'] = False - self.handsplayers[player[1]]['street2Seen'] = False - self.handsplayers[player[1]]['street3Seen'] = False - self.handsplayers[player[1]]['street4Seen'] = False - - - for i in range(5): - self.handsplayers[player[1]]['street%dCalls' % i] = 0 - self.handsplayers[player[1]]['street%dBets' % i] = 0 - self.handsplayers[player[1]]['street%dRaises' % i] = 0 - for i in range(1,5): - self.handsplayers[player[1]]['street%dCBChance' %i] = False - self.handsplayers[player[1]]['street%dCBDone' %i] = False - self.handsplayers[player[1]]['street%dCheckCallRaiseChance' %i] = False - self.handsplayers[player[1]]['street%dCheckCallRaiseDone' %i] = False - self.handsplayers[player[1]]['otherRaisedStreet%d' %i] = False - self.handsplayers[player[1]]['foldToOtherRaisedStreet%d' %i] = False - - #FIXME - Everything below this point is incomplete. - self.handsplayers[player[1]]['other3BStreet0'] = False - self.handsplayers[player[1]]['other4BStreet0'] = False - self.handsplayers[player[1]]['otherRaisedStreet0'] = False - self.handsplayers[player[1]]['foldToOtherRaisedStreet0'] = False - for i in range(1,5): - self.handsplayers[player[1]]['foldToStreet%dCBChance' %i] = False - self.handsplayers[player[1]]['foldToStreet%dCBDone' %i] = False - self.handsplayers[player[1]]['wonWhenSeenStreet2'] = 0.0 - self.handsplayers[player[1]]['wonWhenSeenStreet3'] = 0.0 - self.handsplayers[player[1]]['wonWhenSeenStreet4'] = 0.0 + self.handsplayers[player[1]] = self._initStats.copy() self.assembleHands(self.hand) self.assembleHandsPlayers(self.hand) From 25799d01f209b03f21904eb79f78affc63dfee15 Mon Sep 17 00:00:00 2001 From: Scott Wolchok Date: Fri, 25 Feb 2011 04:19:00 -0500 Subject: [PATCH 09/17] Don't bother recompiling regexs for every hand when parsing Stars HHs. --- pyfpdb/PokerStarsToFpdb.py | 41 +++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/pyfpdb/PokerStarsToFpdb.py b/pyfpdb/PokerStarsToFpdb.py index 67d8c433..4096ca92 100644 --- a/pyfpdb/PokerStarsToFpdb.py +++ b/pyfpdb/PokerStarsToFpdb.py @@ -131,34 +131,29 @@ class PokerStars(HandHistoryConverter): # revised re including timezone (not currently used): #re_DateTime = re.compile("""(?P[0-9]{4})\/(?P[0-9]{2})\/(?P[0-9]{2})[\- ]+(?P[0-9]+):(?P[0-9]+):(?P[0-9]+) \(?(?P[A-Z0-9]+)""", re.MULTILINE) - def compilePlayerRegexs(self, hand): - players = set([player[1] for player in hand.players]) - if not players <= self.compiledPlayers: # x <= y means 'x is subset of y' - # we need to recompile the player regexs. -# TODO: should probably rename re_HeroCards and corresponding method, -# since they are used to find all cards on lines starting with "Dealt to:" -# They still identify the hero. - self.compiledPlayers = players - player_re = "(?P" + "|".join(map(re.escape, players)) + ")" - subst = {'PLYR': player_re, 'CUR': self.sym[hand.gametype['currency']]} - log.debug("player_re: " + player_re) - self.re_PostSB = re.compile(r"^%(PLYR)s: posts small blind %(CUR)s(?P[.0-9]+)" % subst, re.MULTILINE) - self.re_PostBB = re.compile(r"^%(PLYR)s: posts big blind %(CUR)s(?P[.0-9]+)" % subst, re.MULTILINE) - self.re_Antes = re.compile(r"^%(PLYR)s: posts the ante %(CUR)s(?P[.0-9]+)" % subst, re.MULTILINE) - self.re_BringIn = re.compile(r"^%(PLYR)s: brings[- ]in( low|) for %(CUR)s(?P[.0-9]+)" % subst, re.MULTILINE) - self.re_PostBoth = re.compile(r"^%(PLYR)s: posts small \& big blinds %(CUR)s(?P[.0-9]+)" % subst, re.MULTILINE) - self.re_HeroCards = re.compile(r"^Dealt to %(PLYR)s(?: \[(?P.+?)\])?( \[(?P.+?)\])" % subst, re.MULTILINE) - self.re_Action = re.compile(r""" + # These used to be compiled per player, but regression tests say + # we don't have to, and it makes life faster. + short_subst = {'PLYR': r'(?P.+?)', 'CUR': '\$?'} + re_PostSB = re.compile(r"^%(PLYR)s: posts small blind %(CUR)s(?P[.0-9]+)" % short_subst, re.MULTILINE) + re_PostBB = re.compile(r"^%(PLYR)s: posts big blind %(CUR)s(?P[.0-9]+)" % short_subst, re.MULTILINE) + re_Antes = re.compile(r"^%(PLYR)s: posts the ante %(CUR)s(?P[.0-9]+)" % short_subst, re.MULTILINE) + re_BringIn = re.compile(r"^%(PLYR)s: brings[- ]in( low|) for %(CUR)s(?P[.0-9]+)" % short_subst, re.MULTILINE) + re_PostBoth = re.compile(r"^%(PLYR)s: posts small \& big blinds %(CUR)s(?P[.0-9]+)" % short_subst, re.MULTILINE) + re_HeroCards = re.compile(r"^Dealt to %(PLYR)s(?: \[(?P.+?)\])?( \[(?P.+?)\])" % short_subst, re.MULTILINE) + re_Action = re.compile(r""" ^%(PLYR)s:(?P\sbets|\schecks|\sraises|\scalls|\sfolds|\sdiscards|\sstands\spat) (\s(%(CUR)s)?(?P[.\d]+))?(\sto\s%(CUR)s(?P[.\d]+))? # the number discarded goes in \s*(and\sis\sall.in)? (and\shas\sreached\sthe\s[%(CUR)s\d\.]+\scap)? (\scards?(\s\[(?P.+?)\])?)?\s*$""" - % subst, re.MULTILINE|re.VERBOSE) - self.re_ShowdownAction = re.compile(r"^%s: shows \[(?P.*)\]" % player_re, re.MULTILINE) - self.re_CollectPot = re.compile(r"Seat (?P[0-9]+): %(PLYR)s (\(button\) |\(small blind\) |\(big blind\) |\(button\) \(small blind\) |\(button\) \(big blind\) )?(collected|showed \[.*\] and won) \(%(CUR)s(?P[.\d]+)\)(, mucked| with.*|)" % subst, re.MULTILINE) - self.re_sitsOut = re.compile("^%s sits out" % player_re, re.MULTILINE) - self.re_ShownCards = re.compile("^Seat (?P[0-9]+): %s (\(.*\) )?(?Pshowed|mucked) \[(?P.*)\].*" % player_re, re.MULTILINE) + % short_subst, re.MULTILINE|re.VERBOSE) + re_ShowdownAction = re.compile(r"^%s: shows \[(?P.*)\]" % short_subst['PLYR'], re.MULTILINE) + re_sitsOut = re.compile("^%s sits out" % short_subst['PLYR'], re.MULTILINE) + re_ShownCards = re.compile("^Seat (?P[0-9]+): %s (\(.*\) )?(?Pshowed|mucked) \[(?P.*)\].*" % short_subst['PLYR'], re.MULTILINE) + re_CollectPot = re.compile(r"Seat (?P[0-9]+): %(PLYR)s (\(button\) |\(small blind\) |\(big blind\) |\(button\) \(small blind\) |\(button\) \(big blind\) )?(collected|showed \[.*\] and won) \(%(CUR)s(?P[.\d]+)\)(, mucked| with.*|)" % short_subst, re.MULTILINE) + + def compilePlayerRegexs(self, hand): + pass def readSupportedGames(self): return [["ring", "hold", "nl"], From 3455b4ea6975857b9a2e2eec7e6d42e4dc0c67ec Mon Sep 17 00:00:00 2001 From: Worros Date: Fri, 25 Feb 2011 17:46:10 +0800 Subject: [PATCH 10/17] Database: Make sqlite bool adapter use ints not strings Scott Wolchok noted that the adapater was using strings, and possibly only working by luck. Appears to give a 10-15% boost on a 10k hand import --- pyfpdb/Database.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index 6340660d..a459c883 100644 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -454,7 +454,7 @@ class Database: self.connection = sqlite3.connect(self.db_path, detect_types=sqlite3.PARSE_DECLTYPES ) self.__connected = True sqlite3.register_converter("bool", lambda x: bool(int(x))) - sqlite3.register_adapter(bool, lambda x: "1" if x else "0") + sqlite3.register_adapter(bool, lambda x: 1 if x else 0) self.connection.create_function("floor", 1, math.floor) tmp = sqlitemath() self.connection.create_function("mod", 2, tmp.mod) From 890ebb4e0207c62f5b4242636a40ebbe9220f99b Mon Sep 17 00:00:00 2001 From: Worros Date: Fri, 25 Feb 2011 18:06:06 +0800 Subject: [PATCH 11/17] Regression: FTP Razz tourney crasher The line: Villain brings in for 9, and is all in Causes the import to crash. --- ...SNG-2-201102.Villain.allin.on.bringing.txt | Bin 0 -> 2266 bytes ...-2-201102.Villain.allin.on.bringing.txt.gt | 1 + ...201102.Villain.allin.on.bringing.txt.hands | 31 +++ ...-2-201102.Villain.allin.on.bringing.txt.hp | 206 ++++++++++++++++++ 4 files changed, 238 insertions(+) create mode 100644 pyfpdb/regression-test-files/tour/FTP/Stud/Razz-USD-HUSNG-2-201102.Villain.allin.on.bringing.txt create mode 100644 pyfpdb/regression-test-files/tour/FTP/Stud/Razz-USD-HUSNG-2-201102.Villain.allin.on.bringing.txt.gt create mode 100644 pyfpdb/regression-test-files/tour/FTP/Stud/Razz-USD-HUSNG-2-201102.Villain.allin.on.bringing.txt.hands create mode 100644 pyfpdb/regression-test-files/tour/FTP/Stud/Razz-USD-HUSNG-2-201102.Villain.allin.on.bringing.txt.hp diff --git a/pyfpdb/regression-test-files/tour/FTP/Stud/Razz-USD-HUSNG-2-201102.Villain.allin.on.bringing.txt b/pyfpdb/regression-test-files/tour/FTP/Stud/Razz-USD-HUSNG-2-201102.Villain.allin.on.bringing.txt new file mode 100644 index 0000000000000000000000000000000000000000..035e05427a6c07aeb1bbdb27ac7408b784edbc95 GIT binary patch literal 2266 zcmcIlU2hUW6g|%-{)b64rYc%?g$4RXQf=c$qJSob^nrc|L|U3c)5Q4O)pPFM>B7=r z(U8e7!_J*^&pmhM&hKAuaE%FDKo4V%bIv|uitjkX73T*S;GFY-M@Z4cD{D>E&_LDN z9@idoE#SG$s(6WnD*=bxH^3=ooPWk8f4lS{4^P++=p|r>J5yQ}znoV~cZUzUQ_+q{Wo_&P!OSVM(2ntJVdJ zK6#zeQ$`JrIQFTcW_QKoI*q8%5F^^&m|~hOdMh(IrdHB?Xezt<-^f{Kv}NZ-N{EBw z5Astj%Vot*m_40%>FHT6`T)op7z4 zyHpTwA*D9c`HZ?Zwj4po*~@!xrNViItSihw zg|~6}Hm|>Zi;6qb0B2bsXGE>DrzK?7r3<_Jb4I9F=8{!GZ@~_kG+C_|YggpCj25%n z<@@)6t<5_8mHYg=BIy~XDpG+j^njo2dcpJ(2fj Date: Fri, 25 Feb 2011 18:07:14 +0800 Subject: [PATCH 12/17] Hand: Sanitise number from Stud bring-in --- pyfpdb/Hand.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pyfpdb/Hand.py b/pyfpdb/Hand.py index 6e642c20..727ca00d 100644 --- a/pyfpdb/Hand.py +++ b/pyfpdb/Hand.py @@ -1401,6 +1401,7 @@ Add a complete on [street] by [player] to [amountTo] def addBringIn(self, player, bringin): if player is not None: log.debug(_("Bringin: %s, %s") % (player , bringin)) + bringin = bringin.replace(u',', u'') #some sites have commas bringin = Decimal(bringin) self.bets['THIRD'][player].append(bringin) self.stacks[player] -= bringin From 2f067d7945ec3e24fe999490624860920d0025c4 Mon Sep 17 00:00:00 2001 From: Steffen Schaumburg Date: Fri, 25 Feb 2011 13:46:00 +0100 Subject: [PATCH 13/17] a missed l10n string --- pyfpdb/TableWindow.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyfpdb/TableWindow.py b/pyfpdb/TableWindow.py index 4cab43ad..72151d13 100644 --- a/pyfpdb/TableWindow.py +++ b/pyfpdb/TableWindow.py @@ -142,7 +142,7 @@ class Table_Window(object): if self.number is not None: break trys += 1 if trys > 4: - log.error("Can't find table %s" % table_name) + log.error(_("Can't find table %s") % table_name) return None geo = self.get_geometry() From 140ad6be5f795b127e98d293bbbfaaaaf7d5fa55 Mon Sep 17 00:00:00 2001 From: Steffen Schaumburg Date: Fri, 25 Feb 2011 14:31:15 +0100 Subject: [PATCH 14/17] allow it to start when cdecimal is missing --- pyfpdb/Database.py | 7 ++++++- pyfpdb/decimal.py | 4 ---- 2 files changed, 6 insertions(+), 5 deletions(-) delete mode 100644 pyfpdb/decimal.py diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index a459c883..f06ee64b 100644 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -38,7 +38,12 @@ import sys import traceback from datetime import datetime, date, time, timedelta from time import time, strftime, sleep -from decimal import Decimal + +try: + from cdecimal import * +except ImportError: + from decimal import * + import string import re import Queue diff --git a/pyfpdb/decimal.py b/pyfpdb/decimal.py deleted file mode 100644 index e5202d92..00000000 --- a/pyfpdb/decimal.py +++ /dev/null @@ -1,4 +0,0 @@ -try: - from cdecimal import * -except ImportError: - from decimal import * From fc46b70c413d5b2ecd554a154afab1eab6e95560 Mon Sep 17 00:00:00 2001 From: Scott Wolchok Date: Fri, 25 Feb 2011 14:18:12 -0500 Subject: [PATCH 15/17] Rename decimal.py to decimal_wrapper.py so we don't break when cdecimal is not installed. --- pyfpdb/AlchemyFacilities.py | 2 +- pyfpdb/AlchemyMappings.py | 2 +- pyfpdb/CarbonToFpdb.py | 2 +- pyfpdb/Database.py | 2 +- pyfpdb/DerivedStats.py | 2 +- pyfpdb/EverestToFpdb.py | 2 +- pyfpdb/FullTiltPokerSummary.py | 2 +- pyfpdb/Hand.py | 2 +- pyfpdb/HandHistoryConverter.py | 2 +- pyfpdb/OnGameToFpdb.py | 2 +- pyfpdb/PokerStarsSummary.py | 2 +- pyfpdb/PokerStarsToFpdb.py | 2 +- pyfpdb/SitenameSummary.py | 2 +- pyfpdb/TourneySummary.py | 2 +- pyfpdb/WinamaxSummary.py | 2 +- pyfpdb/WinamaxToFpdb.py | 2 +- pyfpdb/{decimal.py => decimal_wrapper.py} | 0 pyfpdb/iPokerToFpdb.py | 2 +- 18 files changed, 17 insertions(+), 17 deletions(-) rename pyfpdb/{decimal.py => decimal_wrapper.py} (100%) diff --git a/pyfpdb/AlchemyFacilities.py b/pyfpdb/AlchemyFacilities.py index fd2082d1..a7f85cd7 100644 --- a/pyfpdb/AlchemyFacilities.py +++ b/pyfpdb/AlchemyFacilities.py @@ -17,7 +17,7 @@ #TODO: gettextify if file is used again -from decimal import Decimal +from decimal_wrapper import Decimal from sqlalchemy import types from sqlalchemy.orm.exc import NoResultFound diff --git a/pyfpdb/AlchemyMappings.py b/pyfpdb/AlchemyMappings.py index b5891c25..a0ddcd25 100644 --- a/pyfpdb/AlchemyMappings.py +++ b/pyfpdb/AlchemyMappings.py @@ -23,7 +23,7 @@ This package contains all classes to be mapped and mappers themselves import logging import re -from decimal import Decimal +from decimal_wrapper import Decimal from sqlalchemy.orm import mapper, relation, reconstructor from sqlalchemy.sql import select from collections import defaultdict diff --git a/pyfpdb/CarbonToFpdb.py b/pyfpdb/CarbonToFpdb.py index b9d80791..2c5dbd5b 100644 --- a/pyfpdb/CarbonToFpdb.py +++ b/pyfpdb/CarbonToFpdb.py @@ -53,7 +53,7 @@ _ = L10n.get_translation() import sys import logging from HandHistoryConverter import * -from decimal import Decimal +from decimal_wrapper import Decimal class Carbon(HandHistoryConverter): diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index 6340660d..2e864e21 100644 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -38,7 +38,7 @@ import sys import traceback from datetime import datetime, date, time, timedelta from time import time, strftime, sleep -from decimal import Decimal +from decimal_wrapper import Decimal import string import re import Queue diff --git a/pyfpdb/DerivedStats.py b/pyfpdb/DerivedStats.py index 93c09571..86a363f3 100644 --- a/pyfpdb/DerivedStats.py +++ b/pyfpdb/DerivedStats.py @@ -17,7 +17,7 @@ #fpdb modules import Card -from decimal import Decimal +from decimal_wrapper import Decimal import logging # logging has been set up in fpdb.py or HUD_main.py, use their settings: diff --git a/pyfpdb/EverestToFpdb.py b/pyfpdb/EverestToFpdb.py index f910ba2f..a9abebc1 100644 --- a/pyfpdb/EverestToFpdb.py +++ b/pyfpdb/EverestToFpdb.py @@ -25,7 +25,7 @@ _ = L10n.get_translation() import sys import logging from HandHistoryConverter import * -from decimal import Decimal +from decimal_wrapper import Decimal class Everest(HandHistoryConverter): diff --git a/pyfpdb/FullTiltPokerSummary.py b/pyfpdb/FullTiltPokerSummary.py index 2edcd81e..1172d27c 100644 --- a/pyfpdb/FullTiltPokerSummary.py +++ b/pyfpdb/FullTiltPokerSummary.py @@ -20,7 +20,7 @@ import L10n _ = L10n.get_translation() -from decimal import Decimal +from decimal_wrapper import Decimal import datetime from Exceptions import FpdbParseError diff --git a/pyfpdb/Hand.py b/pyfpdb/Hand.py index 6e642c20..506b6114 100644 --- a/pyfpdb/Hand.py +++ b/pyfpdb/Hand.py @@ -25,7 +25,7 @@ import sys import traceback import os import os.path -from decimal import Decimal +from decimal_wrapper import Decimal import operator import time,datetime from copy import deepcopy diff --git a/pyfpdb/HandHistoryConverter.py b/pyfpdb/HandHistoryConverter.py index 3f0c51bd..8cf45f02 100644 --- a/pyfpdb/HandHistoryConverter.py +++ b/pyfpdb/HandHistoryConverter.py @@ -26,7 +26,7 @@ import os import os.path import xml.dom.minidom import codecs -from decimal import Decimal +from decimal_wrapper import Decimal import operator from xml.dom.minidom import Node diff --git a/pyfpdb/OnGameToFpdb.py b/pyfpdb/OnGameToFpdb.py index 889f2d24..a7423c00 100755 --- a/pyfpdb/OnGameToFpdb.py +++ b/pyfpdb/OnGameToFpdb.py @@ -31,7 +31,7 @@ log = logging.getLogger("parser") import Configuration from HandHistoryConverter import * -from decimal import Decimal +from decimal_wrapper import Decimal # OnGame HH Format diff --git a/pyfpdb/PokerStarsSummary.py b/pyfpdb/PokerStarsSummary.py index 01a9223b..4caa7a3f 100644 --- a/pyfpdb/PokerStarsSummary.py +++ b/pyfpdb/PokerStarsSummary.py @@ -20,7 +20,7 @@ import L10n _ = L10n.get_translation() -from decimal import Decimal +from decimal_wrapper import Decimal import datetime from Exceptions import FpdbParseError diff --git a/pyfpdb/PokerStarsToFpdb.py b/pyfpdb/PokerStarsToFpdb.py index 4096ca92..060ad85c 100644 --- a/pyfpdb/PokerStarsToFpdb.py +++ b/pyfpdb/PokerStarsToFpdb.py @@ -25,7 +25,7 @@ _ = L10n.get_translation() import sys from HandHistoryConverter import * -from decimal import Decimal +from decimal_wrapper import Decimal # PokerStars HH Format diff --git a/pyfpdb/SitenameSummary.py b/pyfpdb/SitenameSummary.py index d06b9831..f3b76700 100644 --- a/pyfpdb/SitenameSummary.py +++ b/pyfpdb/SitenameSummary.py @@ -20,7 +20,7 @@ import L10n _ = L10n.get_translation() -from decimal import Decimal +from decimal_wrapper import Decimal import datetime from Exceptions import FpdbParseError diff --git a/pyfpdb/TourneySummary.py b/pyfpdb/TourneySummary.py index d83ac1a8..1def7703 100644 --- a/pyfpdb/TourneySummary.py +++ b/pyfpdb/TourneySummary.py @@ -28,7 +28,7 @@ import traceback import logging import os import os.path -from decimal import Decimal +from decimal_wrapper import Decimal import operator import time,datetime from copy import deepcopy diff --git a/pyfpdb/WinamaxSummary.py b/pyfpdb/WinamaxSummary.py index c3a5bd14..c466fbd2 100644 --- a/pyfpdb/WinamaxSummary.py +++ b/pyfpdb/WinamaxSummary.py @@ -18,7 +18,7 @@ import L10n _ = L10n.get_translation() -from decimal import Decimal +from decimal_wrapper import Decimal import datetime from BeautifulSoup import BeautifulSoup diff --git a/pyfpdb/WinamaxToFpdb.py b/pyfpdb/WinamaxToFpdb.py index 6aa6f51c..d0540ec0 100644 --- a/pyfpdb/WinamaxToFpdb.py +++ b/pyfpdb/WinamaxToFpdb.py @@ -29,7 +29,7 @@ import logging import Configuration from HandHistoryConverter import * -from decimal import Decimal +from decimal_wrapper import Decimal import time # Winamax HH Format diff --git a/pyfpdb/decimal.py b/pyfpdb/decimal_wrapper.py similarity index 100% rename from pyfpdb/decimal.py rename to pyfpdb/decimal_wrapper.py diff --git a/pyfpdb/iPokerToFpdb.py b/pyfpdb/iPokerToFpdb.py index 4766d72e..950a9901 100644 --- a/pyfpdb/iPokerToFpdb.py +++ b/pyfpdb/iPokerToFpdb.py @@ -46,7 +46,7 @@ _ = L10n.get_translation() import sys import logging from HandHistoryConverter import * -from decimal import Decimal +from decimal_wrapper import Decimal class iPoker(HandHistoryConverter): From 3e0cf8b2da25e496aceba382085db32ee2f00aaf Mon Sep 17 00:00:00 2001 From: Steffen Schaumburg Date: Sat, 26 Feb 2011 02:36:31 +0100 Subject: [PATCH 16/17] add missing windows py27 links --- packaging/windows/py27-links.txt | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/packaging/windows/py27-links.txt b/packaging/windows/py27-links.txt index 8005ec8d..cb1e413c 100644 --- a/packaging/windows/py27-links.txt +++ b/packaging/windows/py27-links.txt @@ -1,9 +1,16 @@ +This is a list of download links of Windows packages for Python 2.7 of our dependencies. + + +These are as of 26Feb2011: +matplotlib 1.0.1 ... http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.0.1/ +pygtk 2.22 ... http://ftp.gnome.org/pub/GNOME/binaries/win32/pygtk/2.22/ +pycairo 1.8.10 ... http://ftp.gnome.org/pub/GNOME/binaries/win32/pycairo/1.8/ +pyGobject X ... http://ftp.gnome.org/pub/GNOME/binaries/win32/pygobject/2.26/ + + +The below are from Aug2010, and should probably be updated to newer versions: Python 2.7 ... http://python.org/ftp/python/2.7/python-2.7.msi pywin 214 ... https://sourceforge.net/projects/pywin32/files/pywin32/Build%20214/pywin32-214.win32-py2.7.exe/download -matplotlib X ... not available as py27 as of 16aug2010: https://sourceforge.net/projects/matplotlib/files/matplotlib/ -pygtk X ... not available as py27 as of 16aug2010: http://ftp.gnome.org/pub/GNOME/binaries/win32/pygtk/ -pycairo X ... not available as py27 as of 16aug2010: http://ftp.gnome.org/pub/GNOME/binaries/win32/pycairo/ -pyGobject X ... not available as py27 as of 16aug2010: http://ftp.gnome.org/pub/GNOME/binaries/win32/pygobject/ py2exe 0.6.9 ... https://sourceforge.net/projects/py2exe/files/py2exe/0.6.9/py2exe-0.6.9.win32-py2.7.exe/download psycopg2 ... http://www.stickpeople.com/projects/python/win-psycopg/psycopg2-2.2.2.win32-py2.7-pg8.4.4-release.exe From bbbbf98a405882e17e2f54f8b3b2ed51949fb56e Mon Sep 17 00:00:00 2001 From: Steffen Schaumburg Date: Sat, 26 Feb 2011 03:12:45 +0100 Subject: [PATCH 17/17] enable all sites by default --- pyfpdb/HUD_config.xml.example | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pyfpdb/HUD_config.xml.example b/pyfpdb/HUD_config.xml.example index b62d6db1..d6aed156 100644 --- a/pyfpdb/HUD_config.xml.example +++ b/pyfpdb/HUD_config.xml.example @@ -263,7 +263,7 @@ Left-Drag to Move" bgcolor="#000000" converter="EverleafToFpdb" decoder="everleaf_decode_table" - enabled="False" + enabled="True" fgcolor="#EEEEEE" hudopacity="0.75" screen_name="PlayerName" @@ -312,7 +312,7 @@ Left-Drag to Move" - - - - + @@ -542,7 +542,7 @@ Left-Drag to Move" - + @@ -578,7 +578,7 @@ Left-Drag to Move" - + @@ -614,7 +614,7 @@ Left-Drag to Move" - +