Merge branch 'master' of git://git.assembla.com/fpdb-eric

This commit is contained in:
Mika Bostrom 2009-11-01 14:20:03 +02:00
commit 8bb5d53d7e
5 changed files with 23 additions and 7 deletions

View File

@ -555,7 +555,9 @@ class Config:
fav_seat = None, locations = None): fav_seat = None, locations = None):
site_node = self.get_site_node(site_name) site_node = self.get_site_node(site_name)
layout_node = self.get_layout_node(site_node, max) layout_node = self.get_layout_node(site_node, max)
if layout_node == None: return # TODO: how do we support inserting new layouts?
if layout_node == None:
return
for i in range(1, max + 1): for i in range(1, max + 1):
location_node = self.get_location_node(layout_node, i) location_node = self.get_location_node(layout_node, i)
location_node.setAttribute("x", str( locations[i-1][0] )) location_node.setAttribute("x", str( locations[i-1][0] ))

View File

@ -761,14 +761,18 @@ class Database:
hands_id = self.storeHands( self.backend, siteHandNo, gametypeId hands_id = self.storeHands( self.backend, siteHandNo, gametypeId
, handStartTime, names, tableName, maxSeats , handStartTime, names, tableName, maxSeats
, hudImportData, board_values, board_suits ) , hudImportData, (None, None, None, None, None), (None, None, None, None, None) )
# changed board_values and board_suits to arrays of None, just like the
# cash game version of this function does - i don't believe this to be
# the correct thing to do (tell me if i'm wrong) but it should keep the
# importer from crashing
hands_players_ids = self.store_hands_players_stud_tourney(self.backend, hands_id hands_players_ids = self.store_hands_players_stud_tourney(self.backend, hands_id
, playerIds, startCashes, antes, cardValues, cardSuits , playerIds, startCashes, antes, cardValues, cardSuits
, winnings, rakes, seatNos, tourneys_players_ids, tourneyTypeId) , winnings, rakes, seatNos, tourneys_players_ids, tourneyTypeId)
if 'dropHudCache' not in settings or settings['dropHudCache'] != 'drop': if 'dropHudCache' not in settings or settings['dropHudCache'] != 'drop':
self.storeHudCache(self.backend, base, category, gametypeId, hand_start_time, playerIds, hudImportData) self.storeHudCache(self.backend, base, category, gametypeId, handStartTime, playerIds, hudImportData)
return hands_id return hands_id
#end def tourney_stud #end def tourney_stud
@ -1946,7 +1950,7 @@ class Database:
def store_hands_players_stud_tourney(self, backend, hands_id, player_ids, start_cashes, def store_hands_players_stud_tourney(self, backend, hands_id, player_ids, start_cashes,
antes, card_values, card_suits, winnings, rakes, seatNos, tourneys_players_ids, tourneyTypeId): antes, card_values, card_suits, winnings, rakes, seatNos, tourneys_players_ids, tourneyTypeId):
#stores hands_players for tourney stud/razz hands #stores hands_players for tourney stud/razz hands
return # TODO: stubbed out until someone updates it for current database structuring
try: try:
result=[] result=[]
for i in xrange(len(player_ids)): for i in xrange(len(player_ids)):

View File

@ -451,7 +451,10 @@ or None if we fail to get the info """
self.doc = doc self.doc = doc
def guessMaxSeats(self, hand): def guessMaxSeats(self, hand):
"""Return a guess at max_seats when not specified in HH.""" """Return a guess at maxseats when not specified in HH."""
# if some other code prior to this has already set it, return it
if maxseats > 1 and maxseats < 11:
return maxseats
mo = self.maxOccSeat(hand) mo = self.maxOccSeat(hand)
if mo == 10: return 10 #that was easy if mo == 10: return 10 #that was easy

View File

@ -455,6 +455,9 @@ class Hud:
# Need range here, not xrange -> need the actual list # Need range here, not xrange -> need the actual list
adj = range(0, self.max + 1) # default seat adjustments = no adjustment adj = range(0, self.max + 1) # default seat adjustments = no adjustment
# does the user have a fav_seat? # does the user have a fav_seat?
if self.max not in config.supported_sites[self.table.site].layout:
sys.stderr.write("No layout found for %d-max games for site %s\n" % (self.max, self.table.site) )
return adj
if self.table.site != None and int(config.supported_sites[self.table.site].layout[self.max].fav_seat) > 0: if self.table.site != None and int(config.supported_sites[self.table.site].layout[self.max].fav_seat) > 0:
try: try:
fav_seat = config.supported_sites[self.table.site].layout[self.max].fav_seat fav_seat = config.supported_sites[self.table.site].layout[self.max].fav_seat
@ -494,6 +497,10 @@ class Hud:
sys.stderr.write("------------------------------------------------------------\nCreating hud from hand %s\n" % hand) sys.stderr.write("------------------------------------------------------------\nCreating hud from hand %s\n" % hand)
adj = self.adj_seats(hand, config) adj = self.adj_seats(hand, config)
loc = self.config.get_locations(self.table.site, self.max) loc = self.config.get_locations(self.table.site, self.max)
if loc is None and self.max != 10:
loc = self.config.get_locations(self.table.site, 10)
if loc is None and self.max != 9:
loc = self.config.get_locations(self.table.site, 9)
# create the stat windows # create the stat windows
for i in xrange(1, self.max + 1): for i in xrange(1, self.max + 1):

View File

@ -513,10 +513,10 @@ class fpdb:
# self.lock.release() # self.lock.release()
def quit(self, widget, data=None): def quit(self, widget, data=None):
# TODO: can we get some / all of the stuff done in this function to execute on any kind of abort?
print "Quitting normally" print "Quitting normally"
#check if current settings differ from profile, if so offer to save or abort # TODO: check if current settings differ from profile, if so offer to save or abort
self.db.disconnect() self.db.disconnect()
# hide icon as it doesn't go away immediately in Windows - is this ok in Linux Eric?
self.statusIcon.set_visible(False) self.statusIcon.set_visible(False)
gtk.main_quit() gtk.main_quit()