Merge branch 'master' of git://git.assembla.com/fpdboz.git

This commit is contained in:
Gerko de Roo 2010-01-24 13:37:27 +01:00
commit 73ae88e47a
4 changed files with 14 additions and 44 deletions

View File

@ -1,8 +1,8 @@
free-poker-tools (0.12-1) unstable; urgency=low free-poker-tools (0.12~git20100122) unstable; urgency=low
* New release * New snapshot release with reworked import code
-- Mika Bostrom <bostik+fpdb@bostik.iki.fi> Mon, 26 Oct 2009 17:49:07 +0200 -- Mika Bostrom <bostik+fpdb@bostik.iki.fi> Fri, 22 Jan 2010 09:25:27 +0200
free-poker-tools (0.11.3+git20091023) unstable; urgency=low free-poker-tools (0.11.3+git20091023) unstable; urgency=low

View File

@ -360,28 +360,6 @@ class Database:
cards['common'] = c.fetchone() cards['common'] = c.fetchone()
return cards return cards
def convert_cards(self, d):
ranks = ('', '', '2', '3', '4', '5', '6', '7', '8', '9', 'T', 'J', 'Q', 'K', 'A')
cards = ""
for i in xrange(1, 8):
# key = 'card' + str(i) + 'Value'
# if not d.has_key(key): continue
# if d[key] == None:
# break
# elif d[key] == 0:
# cards += "xx"
# else:
# cards += ranks[d['card' + str(i) + 'Value']] + d['card' +str(i) + 'Suit']
cv = "card%dvalue" % i
if cv not in d or d[cv] is None:
break
elif d[cv] == 0:
cards += "xx"
else:
cs = "card%dsuit" % i
cards = "%s%s%s" % (cards, ranks[d[cv]], d[cs])
return cards
def get_action_from_hand(self, hand_no): def get_action_from_hand(self, hand_no):
action = [ [], [], [], [], [] ] action = [ [], [], [], [], [] ]
c = self.connection.cursor() c = self.connection.cursor()

View File

@ -683,7 +683,6 @@ class HoldemOmahaHand(Hand):
def join_holecards(self, player, asList=False): def join_holecards(self, player, asList=False):
"""With asList = True it returns the set cards for a player including down cards if they aren't know""" """With asList = True it returns the set cards for a player including down cards if they aren't know"""
# FIXME: This should actually return
hcs = [u'0x', u'0x', u'0x', u'0x'] hcs = [u'0x', u'0x', u'0x', u'0x']
for street in self.holeStreets: for street in self.holeStreets:

View File

@ -457,9 +457,7 @@ class Hud:
# TODO: is stat_windows getting converted somewhere from a list to a dict, for no good reason? # TODO: is stat_windows getting converted somewhere from a list to a dict, for no good reason?
for i, w in enumerate(self.stat_windows.itervalues()): for i, w in enumerate(self.stat_windows.itervalues()):
(x, y) = loc[adj[i+1]] (x, y) = loc[adj[i+1]]
px = int(x * self.table.width / 1000) w.relocate(x, y)
py = int(y * self.table.height / 1000)
w.relocate(px, py)
# While we're at it, fix the positions of mucked cards too # While we're at it, fix the positions of mucked cards too
for aux in self.aux_windows: for aux in self.aux_windows:
@ -509,11 +507,9 @@ class Hud:
def save_layout(self, *args): def save_layout(self, *args):
new_layout = [(0, 0)] * self.max new_layout = [(0, 0)] * self.max
width = self.table.width
height = self.table.height
for sw in self.stat_windows: for sw in self.stat_windows:
(x,y) = self.stat_windows[sw].window.get_position() loc = self.stat_windows[sw].window.get_position()
new_loc = (int((x - self.table.x)*1000/width), int((y - self.table.y)*1000/height)) new_loc = (loc[0] - self.table.x, loc[1] - self.table.y)
new_layout[self.stat_windows[sw].adj - 1] = new_loc new_layout[self.stat_windows[sw].adj - 1] = new_loc
self.config.edit_layout(self.table.site, self.max, locations = new_layout) self.config.edit_layout(self.table.site, self.max, locations = new_layout)
# ask each aux to save its layout back to the config object # ask each aux to save its layout back to the config object
@ -575,21 +571,16 @@ class Hud:
loc = self.config.get_locations(self.table.site, 9) loc = self.config.get_locations(self.table.site, 9)
# create the stat windows # create the stat windows
# get the width and height of the client window
# The x and Y positions are now made relative.
for i in xrange(1, self.max + 1): for i in xrange(1, self.max + 1):
(x, y) = loc[adj[i]] (x, y) = loc[adj[i]]
px = int(x * self.table.width / 1000)
py = int(y * self.table.height / 1000)
if i in self.stat_windows: if i in self.stat_windows:
self.stat_windows[i].relocate(px, py) self.stat_windows[i].relocate(x, y)
else: else:
self.stat_windows[i] = Stat_Window(game = config.supported_games[self.poker_game], self.stat_windows[i] = Stat_Window(game = config.supported_games[self.poker_game],
parent = self, parent = self,
table = self.table, table = self.table,
x = px, x = x,
y = py, y = y,
seat = i, seat = i,
adj = adj[i], adj = adj[i],
player_id = 'fake', player_id = 'fake',
@ -685,6 +676,8 @@ class Stat_Window:
return True return True
if event.button == 1: # left button event if event.button == 1: # left button event
# close on double click for a stat window
# for those that don't have a mouse with middle button
if event.type == gtk.gdk._2BUTTON_PRESS: if event.type == gtk.gdk._2BUTTON_PRESS:
self.window.hide() self.window.hide()
return True return True