diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index e0647893..ec3d9a4e 100644 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -1826,7 +1826,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): @@ -1835,7 +1835,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] diff --git a/pyfpdb/DerivedStats.py b/pyfpdb/DerivedStats.py index c81988e6..7778c956 100644 --- a/pyfpdb/DerivedStats.py +++ b/pyfpdb/DerivedStats.py @@ -289,10 +289,11 @@ class DerivedStats(): # actions = hand.actions[hand.actionStreets[-1]] # 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) + + # 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']]) - # 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 a069d89c..454f7e79 100755 --- a/pyfpdb/EverleafToFpdb.py +++ b/pyfpdb/EverleafToFpdb.py @@ -34,11 +34,11 @@ 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_Button = re.compile(ur"^Seat (?P
.+$)", re.MULTILINE) + re_Button = re.compile(ur"^Seat (?P
[0-9]+)\.txt") @@ -50,16 +50,16 @@ 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_HeroCards = re.compile(ur"^Dealt to %s \[ (?P.*) \]" % player_re, re.MULTILINE) - self.re_Action = re.compile(ur"^%s(?P: bets| checks| raises| calls| folds)(\s\[(?:\$| €|) (?P[.,\d]+) (USD|EURO|Chips)\])?" % player_re, re.MULTILINE) - #self.re_Action = re.compile(ur"^%s(?P: bets| checks| raises| calls| folds| complete to)(\s\[?(?:\$| €|) ?(?P\d+\.?\d*)\.?\s?(USD|EUR|)\]?)?" % 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 (?:\$| €|) (?P[.\d]+) (USD|EURO|chips)(.*?\[ (?P.*?) \])?" % 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) + # ^%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_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) def readSupportedGames(self): @@ -112,7 +112,7 @@ or None if we fail to get the info """ 'Razz' : ('stud','razz'), '7 Card Stud' : ('stud','studhi') } - currencies = { u' €':'EUR', '$':'USD', '':'T$' } + currencies = { u'€':'EUR', '$':'USD', '':'T$'} if 'LIMIT' in mg: info['limitType'] = limits[mg['LIMIT']] if 'GAME' in mg: @@ -140,6 +140,11 @@ or None if we fail to get the info """ hand.handid = m.group('HID') hand.tablename = m.group('TABLE') hand.maxseats = 6 # assume 6-max unless we have proof it's a larger/smaller game, since everleaf doesn't give seat max info + + currencies = { u'€':'EUR', '$':'USD', '':'T$', None:'T$' } + mg = m.groupdict() + hand.gametype['currency'] = currencies[mg['CURRENCY']] + t = self.re_TourneyInfoFromFilename.search(self.in_path) if t: 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 diff --git a/pyfpdb/SQL.py b/pyfpdb/SQL.py index 91209057..73505129 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 """