Merge branch 'master' of git://github.com/kangaderoo/fpdb-kangaderoo
Conflicts: run_fpdb.py
This commit is contained in:
commit
17bc9af88e
|
@ -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]
|
||||
|
|
|
@ -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) ) ):
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -46,9 +46,9 @@ class PokerStars(HandHistoryConverter):
|
|||
PokerStars\sGame\s\#(?P<HID>[0-9]+):\s+
|
||||
(Tournament\s\# # open paren of tournament info
|
||||
(?P<TOURNO>\d+),\s
|
||||
(?P<BUYIN>[%(LS)s\+\d\.]+ # here's how I plan to use LS
|
||||
\s?(?P<TOUR_ISO>%(LEGAL_ISO)s)?
|
||||
)\s)? # close paren of tournament info
|
||||
# here's how I plan to use LS
|
||||
(?P<BUYIN>([%(LS)s\+\d\.]+\s?(?P<TOUR_ISO>%(LEGAL_ISO)s)?)|Freeroll)\s+)?
|
||||
# close paren of tournament info
|
||||
(?P<MIXED>HORSE|8\-Game|HOSE)?\s?\(?
|
||||
(?P<GAME>Hold\'em|Razz|7\sCard\sStud|7\sCard\sStud\sHi/Lo|Omaha|Omaha\sHi/Lo|Badugi|Triple\sDraw\s2\-7\sLowball|5\sCard\sDraw)\s
|
||||
(?P<LIMIT>No\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]
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user