From a11f4f61cd37b9f7092ec518909cb64ff70ab9e6 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Jul 2010 17:27:07 -0400 Subject: [PATCH 1/7] store game currency --- pyfpdb/Database.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index 500dfb0a..c84f4a04 100644 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -1822,7 +1822,7 @@ class Database: def getGameTypeId(self, siteid, game): c = self.get_cursor() #FIXME: Fixed for NL at the moment - c.execute(self.sql.query['getGametypeNL'], (siteid, game['type'], game['category'], game['limitType'], + c.execute(self.sql.query['getGametypeNL'], (siteid, game['type'], game['category'], game['limitType'], game['currency'], int(Decimal(game['sb'])*100), int(Decimal(game['bb'])*100))) tmp = c.fetchone() if (tmp == None): @@ -1831,7 +1831,7 @@ class Database: hilo = "s" elif game['category'] in ['razz','27_3draw','badugi']: hilo = "l" - tmp = self.insertGameTypes( (siteid, 'USD', game['type'], game['base'], game['category'], game['limitType'], hilo, + tmp = self.insertGameTypes( (siteid, game['currency'], game['type'], game['base'], game['category'], game['limitType'], hilo, int(Decimal(game['sb'])*100), int(Decimal(game['bb'])*100), 0, 0) ) #FIXME: recognise currency return tmp[0] From 4fa5ce2411e7160f8405b3bf921183adfc7aec6d Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Jul 2010 17:27:36 -0400 Subject: [PATCH 2/7] sql.py change for storing currency --- pyfpdb/SQL.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pyfpdb/SQL.py b/pyfpdb/SQL.py index fcebc5c9..ae088b36 100644 --- a/pyfpdb/SQL.py +++ b/pyfpdb/SQL.py @@ -3741,6 +3741,7 @@ class Sql: AND type=%s AND category=%s AND limitType=%s + AND currency=%s AND smallBlind=%s AND bigBlind=%s """ From 981dcc632c44fab086b1d6e5df71bb369d0b5023 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Jul 2010 17:52:19 -0400 Subject: [PATCH 3/7] everleaf euro support --- pyfpdb/EverleafToFpdb.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/pyfpdb/EverleafToFpdb.py b/pyfpdb/EverleafToFpdb.py index a069d89c..1fb4381a 100755 --- a/pyfpdb/EverleafToFpdb.py +++ b/pyfpdb/EverleafToFpdb.py @@ -34,9 +34,9 @@ class Everleaf(HandHistoryConverter): # Static regexes re_SplitHands = re.compile(r"\n\n\n+") re_TailSplitHands = re.compile(r"(\n\n\n+)") - re_GameInfo = re.compile(ur"^(Blinds )?(?P\$| €|)(?P[.0-9]+)/(?:\$| €)?(?P[.0-9]+) (?PNL|PL|) ?(?P(Hold\'em|Omaha|7 Card Stud))", re.MULTILINE) - #re.compile(ur"^(Blinds )?(?P\$| €|)(?P[.0-9]+)/(?:\$| €)?(?P[.0-9]+) (?PNL|PL|) (?P(Hold\'em|Omaha|7 Card Stud))", re.MULTILINE) - re_HandInfo = re.compile(ur".*#(?P[0-9]+)\n.*\n(Blinds )?(?:\$| €|)(?P[.0-9]+)/(?:\$| €|)(?P[.0-9]+) (?P.*) - (?P\d\d\d\d/\d\d/\d\d - \d\d:\d\d:\d\d)\nTable (?P.+$)", re.MULTILINE) + re_GameInfo = re.compile(ur"^(Blinds )?(?P[$€]?)(?P[.0-9]+)/(?:\$|€)?(?P[.0-9]+) (?PNL|PL|) ?(?P(Hold\'em|Omaha|7 Card Stud))", re.MULTILINE) + #re.compile(ur"^(Blinds )?(?P\$| €|)(?P[.0-9]+)/(?:\$| €)?(?P[.0-9]+) (?PNL|PL|) ?(?P(Hold\'em|Omaha|7 Card Stud))", re.MULTILINE) + re_HandInfo = re.compile(ur".*#(?P[0-9]+)\n.*\n(Blinds )?(?P[$€])?(?P[.0-9]+)/(?:[$€])?(?P[.0-9]+) (?P.*) - (?P\d\d\d\d/\d\d/\d\d - \d\d:\d\d:\d\d)\nTable (?P
.+$)", re.MULTILINE) re_Button = re.compile(ur"^Seat (?P
.+$)", re.MULTILINE) re_Button = re.compile(ur"^Seat (?P
[0-9]+)\.txt") @@ -50,11 +50,11 @@ class Everleaf(HandHistoryConverter): self.compiledPlayers = players player_re = "(?P" + "|".join(map(re.escape, players)) + ")" logging.debug("player_re: "+ player_re) - self.re_PostSB = re.compile(ur"^%s: posts small blind \[(?:\$| €|) (?P[.0-9]+)" % player_re, re.MULTILINE) - self.re_PostBB = re.compile(ur"^%s: posts big blind \[(?:\$| €|) (?P[.0-9]+)" % player_re, re.MULTILINE) - self.re_PostBoth = re.compile(ur"^%s: posts both blinds \[(?:\$| €|) (?P[.0-9]+)" % player_re, re.MULTILINE) - self.re_Antes = re.compile(ur"^%s: posts ante \[(?:\$| €|) (?P[.0-9]+)" % player_re, re.MULTILINE) - self.re_BringIn = re.compile(ur"^%s posts bring-in (?:\$| €|)(?P[.0-9]+)\." % player_re, re.MULTILINE) + self.re_PostSB = re.compile(ur"^%s: posts small blind \[[$€]? (?P[.0-9]+)" % player_re, re.MULTILINE) + self.re_PostBB = re.compile(ur"^%s: posts big blind \[[$€]? (?P[.0-9]+)" % player_re, re.MULTILINE) + self.re_PostBoth = re.compile(ur"^%s: posts both blinds \[[$€]? (?P[.0-9]+)" % player_re, re.MULTILINE) + self.re_Antes = re.compile(ur"^%s: posts ante \[[$€]? (?P[.0-9]+)" % player_re, re.MULTILINE) + self.re_BringIn = re.compile(ur"^%s posts bring-in [$€]? (?P[.0-9]+)\." % player_re, re.MULTILINE) self.re_HeroCards = re.compile(ur"^Dealt to %s \[ (?P.*) \]" % player_re, re.MULTILINE) # ^%s(?P: bets| checks| raises| calls| folds)(\s\[(?:\$| €|) (?P[.,\d]+) (USD|EURO|Chips)\])? self.re_Action = re.compile(ur"^%s(?P: bets| checks| raises| calls| folds)(\s\[(?:[$€]?) (?P[.,\d]+)\s?(USD|EURO|Chips|)\])?" % player_re, re.MULTILINE) From e8d39711dd9d67746d384bf6eeb9e55388fd21bb Mon Sep 17 00:00:00 2001 From: Eric Blade Date: Sat, 31 Jul 2010 17:24:06 -0400 Subject: [PATCH 6/7] fix from carl for wtsd, more tweaks to everleaf regexes --- pyfpdb/DerivedStats.py | 5 ++++- pyfpdb/EverleafToFpdb.py | 16 ++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/pyfpdb/DerivedStats.py b/pyfpdb/DerivedStats.py index e92bfeaa..7778c956 100644 --- a/pyfpdb/DerivedStats.py +++ b/pyfpdb/DerivedStats.py @@ -290,7 +290,10 @@ class DerivedStats(): # print "p_actions:", self.pfba(actions), "p_folds:", self.pfba(actions, l=('folds',)), "alliners:", alliners # pas = set.union(self.pfba(actions) - self.pfba(actions, l=('folds',)), alliners) - p_in = set(x[1] for x in hand.players) + # hand.players includes people that are sitting out on some sites. + # Those that posted an ante should have been deal cards. + p_in = set([x[0] for x in hand.actions['BLINDSANTES']]) + for (i, street) in enumerate(hand.actionStreets): actions = hand.actions[street] p_in = p_in - self.pfba(actions, l=('folds',)) diff --git a/pyfpdb/EverleafToFpdb.py b/pyfpdb/EverleafToFpdb.py index 9da5966f..454f7e79 100755 --- a/pyfpdb/EverleafToFpdb.py +++ b/pyfpdb/EverleafToFpdb.py @@ -37,8 +37,8 @@ class Everleaf(HandHistoryConverter): re_GameInfo = re.compile(ur"^(Blinds )?(?P[$€]?)(?P[.0-9]+)/[$€]?(?P[.0-9]+) (?PNL|PL|) ?(?P(Hold\'em|Omaha|7 Card Stud))", re.MULTILINE) #re.compile(ur"^(Blinds )?(?P\$| €|)(?P[.0-9]+)/(?:\$| €)?(?P[.0-9]+) (?PNL|PL|) ?(?P(Hold\'em|Omaha|7 Card Stud))", re.MULTILINE) re_HandInfo = re.compile(ur".*#(?P[0-9]+)\n.*\n(Blinds )?(?P[$€])?(?P[.0-9]+)/(?:[$€])?(?P[.0-9]+) (?P.*) - (?P\d\d\d\d/\d\d/\d\d - \d\d:\d\d:\d\d)\nTable (?P
.+$)", re.MULTILINE) - re_Button = re.compile(ur"^Seat (?P
[0-9]+)\.txt") @@ -50,15 +50,15 @@ class Everleaf(HandHistoryConverter): self.compiledPlayers = players player_re = "(?P" + "|".join(map(re.escape, players)) + ")" logging.debug("player_re: "+ player_re) - self.re_PostSB = re.compile(ur"^%s: posts small blind \[[$€]? (?P[.0-9]+)" % player_re, re.MULTILINE) - self.re_PostBB = re.compile(ur"^%s: posts big blind \[[$€]? (?P[.0-9]+)" % player_re, re.MULTILINE) - self.re_PostBoth = re.compile(ur"^%s: posts both blinds \[[$€]? (?P[.0-9]+)" % player_re, re.MULTILINE) - self.re_Antes = re.compile(ur"^%s: posts ante \[[$€]? (?P[.0-9]+)" % player_re, re.MULTILINE) + self.re_PostSB = re.compile(ur"^%s: posts small blind \[[$€]? (?P[.0-9]+)\s.*\]$" % player_re, re.MULTILINE) + self.re_PostBB = re.compile(ur"^%s: posts big blind \[[$€]? (?P[.0-9]+)\s.*\]$" % player_re, re.MULTILINE) + self.re_PostBoth = re.compile(ur"^%s: posts both blinds \[[$€]? (?P[.0-9]+)\s.*\]$" % player_re, re.MULTILINE) + self.re_Antes = re.compile(ur"^%s: posts ante \[[$€]? (?P[.0-9]+)\s.*\]$" % player_re, re.MULTILINE) self.re_BringIn = re.compile(ur"^%s posts bring-in [$€]? (?P[.0-9]+)\." % player_re, re.MULTILINE) - self.re_HeroCards = re.compile(ur"^Dealt to %s \[ (?P.*) \]" % player_re, re.MULTILINE) + self.re_HeroCards = re.compile(ur"^Dealt to %s \[ (?P.*) \]$" % player_re, re.MULTILINE) # ^%s(?P: bets| checks| raises| calls| folds)(\s\[(?:\$| €|) (?P[.,\d]+) (USD|EURO|Chips)\])? self.re_Action = re.compile(ur"^%s(?P: bets| checks| raises| calls| folds)(\s\[(?:[$€]?) (?P[.,\d]+)\s?(USD|EURO|Chips|)\])?" % player_re, re.MULTILINE) - self.re_ShowdownAction = re.compile(ur"^%s shows \[ (?P.*) \]" % player_re, re.MULTILINE) + self.re_ShowdownAction = re.compile(ur"^%s shows \[ (?P.*) \]$" % player_re, re.MULTILINE) self.re_CollectPot = re.compile(ur"^%s wins (?:[$€]?)\s?(?P[.\d]+) (USD|EURO|chips)(.*?\[ (?P.*?) \])?" % player_re, re.MULTILINE) self.re_SitsOut = re.compile(ur"^%s sits out" % player_re, re.MULTILINE) From d3f99eec9b18324c63557e4688e0c8289ea46a8a Mon Sep 17 00:00:00 2001 From: Eric Blade Date: Sun, 1 Aug 2010 03:05:35 -0400 Subject: [PATCH 7/7] call reposition_windows after doing a window move, so that the user doesn't need to hit the menu option to do it (reposition_windows manages to successfully move the hidden windows, whereas the original move doesn't, for some reason) --- pyfpdb/Hud.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyfpdb/Hud.py b/pyfpdb/Hud.py index 8d3d7d0c..a92682e7 100644 --- a/pyfpdb/Hud.py +++ b/pyfpdb/Hud.py @@ -469,6 +469,9 @@ class Hud: # While we're at it, fix the positions of mucked cards too for aux in self.aux_windows: aux.update_card_positions() + + self.reposition_windows() + # call reposition_windows, which apparently moves even hidden windows, where this function does not, even though they do the same thing, afaict return True