diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index 54690979..ee43079c 100644 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -787,7 +787,8 @@ class Database: def get_player_id(self, config, site, player_name): c = self.connection.cursor() - c.execute(self.sql.query['get_player_id'], (player_name, site)) + p_name = Charset.to_utf8(player_name) + c.execute(self.sql.query['get_player_id'], (p_name, site)) row = c.fetchone() if row: return row[0] diff --git a/pyfpdb/GuiPlayerStats.py b/pyfpdb/GuiPlayerStats.py index 564513f0..11b14274 100644 --- a/pyfpdb/GuiPlayerStats.py +++ b/pyfpdb/GuiPlayerStats.py @@ -274,7 +274,7 @@ class GuiPlayerStats (threading.Thread): except: a = 0.0 try: b = float(b) except: b = 0.0 - if n == 0: + if n == 0 and grid == 1: #make sure it only works on the starting hands a1,a2,a3 = ranks[a[0]], ranks[a[1]], (a+'o')[2] b1,b2,b3 = ranks[b[0]], ranks[b[1]], (b+'o')[2] if a1 > b1 or ( a1 == b1 and (a2 > b2 or (a2 == b2 and a3 > b3) ) ): diff --git a/pyfpdb/Mucked.py b/pyfpdb/Mucked.py index c072fb54..a6f48605 100755 --- a/pyfpdb/Mucked.py +++ b/pyfpdb/Mucked.py @@ -358,21 +358,24 @@ class Aux_Seats(Aux_Window): except AttributeError: return loc = self.config.get_aux_locations(self.params['name'], int(self.hud.max)) + width = self.hud.table.width + height = self.hud.table.height + for i in (range(1, self.hud.max + 1) + ['common']): if i == 'common': (x, y) = self.params['layout'][self.hud.max].common else: (x, y) = loc[adj[i]] - self.positions[i] = self.card_positions(x, self.hud.table.x, y, self.hud.table.y) + self.positions[i] = self.card_positions((x * width) / 1000, self.hud.table.x, (y * height) /1000, self.hud.table.y) self.m_windows[i].move(self.positions[i][0], self.positions[i][1]) - def create(self): self.adj = self.hud.adj_seats(0, self.config) # move adj_seats to aux and get rid of it in Hud.py loc = self.config.get_aux_locations(self.params['name'], int(self.hud.max)) self.m_windows = {} # windows to put the card images in - + width = self.hud.table.width + height = self.hud.table.height for i in (range(1, self.hud.max + 1) + ['common']): if i == 'common': (x, y) = self.params['layout'][self.hud.max].common @@ -384,7 +387,7 @@ class Aux_Seats(Aux_Window): self.m_windows[i].set_transient_for(self.hud.main_window) self.m_windows[i].set_focus_on_map(False) self.m_windows[i].connect("configure_event", self.configure_event_cb, i) - self.positions[i] = self.card_positions(x, self.hud.table.x, y, self.hud.table.y) + self.positions[i] = self.card_positions((x * width) / 1000, self.hud.table.x, (y * height) /1000, self.hud.table.y) self.m_windows[i].move(self.positions[i][0], self.positions[i][1]) if self.params.has_key('opacity'): self.m_windows[i].set_opacity(float(self.params['opacity'])) @@ -426,11 +429,13 @@ class Aux_Seats(Aux_Window): """Save new layout back to the aux element in the config file.""" new_locs = {} # print "adj =", self.adj + witdh = self.hud.table.width + height = self.hud.table.height for (i, pos) in self.positions.iteritems(): - if i != 'common': - new_locs[self.adj[int(i)]] = (pos[0] - self.hud.table.x, pos[1] - self.hud.table.y) - else: - new_locs[i] = (pos[0] - self.hud.table.x, pos[1] - self.hud.table.y) + if i != 'common': + new_locs[self.adj[int(i)]] = ((pos[0] - self.hud.table.x) * 1000 / witdh, (pos[1] - self.hud.table.y) * 1000 / height) + else: + new_locs[i] = ((pos[0] - self.hud.table.x) * 1000 / witdh, (pos[1] - self.hud.table.y) * 1000 / height) self.config.edit_aux_layout(self.params['name'], self.hud.max, locations = new_locs) def configure_event_cb(self, widget, event, i, *args): diff --git a/pyfpdb/PokerStarsToFpdb.py b/pyfpdb/PokerStarsToFpdb.py index 2a4fbdb6..c8bfea70 100755 --- a/pyfpdb/PokerStarsToFpdb.py +++ b/pyfpdb/PokerStarsToFpdb.py @@ -46,9 +46,9 @@ class PokerStars(HandHistoryConverter): PokerStars\sGame\s\#(?P[0-9]+):\s+ (Tournament\s\# # open paren of tournament info (?P\d+),\s - (?P[%(LS)s\+\d\.]+ # here's how I plan to use LS - \s?(?P%(LEGAL_ISO)s)? - )\s)? # close paren of tournament info + # here's how I plan to use LS + (?P([%(LS)s\+\d\.]+\s?(?P%(LEGAL_ISO)s)?)|Freeroll)\s+)? + # close paren of tournament info (?PHORSE|8\-Game|HOSE)?\s?\(? (?PHold\'em|Razz|7\sCard\sStud|7\sCard\sStud\sHi/Lo|Omaha|Omaha\sHi/Lo|Badugi|Triple\sDraw\s2\-7\sLowball|5\sCard\sDraw)\s (?PNo\sLimit|Limit|Pot\sLimit)\)?,?\s @@ -205,9 +205,12 @@ class PokerStars(HandHistoryConverter): if key == 'TOURNO': hand.tourNo = info[key] if key == 'BUYIN': - #FIXME: The key looks like: '€0.82+€0.18 EUR' - # This should be parsed properly and used - hand.buyin = info[key] + if info[key] == 'Freeroll': + hand.buyin = '$0+$0' + else: + #FIXME: The key looks like: '€0.82+€0.18 EUR' + # This should be parsed properly and used + hand.buyin = info[key] if key == 'LEVEL': hand.level = info[key] diff --git a/run_fpdb.py b/run_fpdb.py index 78e2803b..570b7dc5 100755 --- a/run_fpdb.py +++ b/run_fpdb.py @@ -24,7 +24,6 @@ sys.path[0] = sys.path[0]+os.sep+"pyfpdb" os.chdir(sys.path[0]) #print "sys.path[0] =", sys.path[0], "cwd =", os.getcwd() - import fpdb