diff --git a/pyfpdb/Configuration.py b/pyfpdb/Configuration.py index c89546ca..620217ab 100755 --- a/pyfpdb/Configuration.py +++ b/pyfpdb/Configuration.py @@ -555,7 +555,9 @@ class Config: fav_seat = None, locations = None): site_node = self.get_site_node(site_name) 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): location_node = self.get_location_node(layout_node, i) location_node.setAttribute("x", str( locations[i-1][0] )) diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index ba71310b..5bf7f488 100755 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -761,14 +761,18 @@ class Database: hands_id = self.storeHands( self.backend, siteHandNo, gametypeId , 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 , playerIds, startCashes, antes, cardValues, cardSuits , winnings, rakes, seatNos, tourneys_players_ids, tourneyTypeId) 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 #end def tourney_stud @@ -1946,7 +1950,7 @@ class Database: 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): #stores hands_players for tourney stud/razz hands - + return # TODO: stubbed out until someone updates it for current database structuring try: result=[] for i in xrange(len(player_ids)): diff --git a/pyfpdb/HandHistoryConverter.py b/pyfpdb/HandHistoryConverter.py index 0642d845..0024cfe5 100644 --- a/pyfpdb/HandHistoryConverter.py +++ b/pyfpdb/HandHistoryConverter.py @@ -451,7 +451,10 @@ or None if we fail to get the info """ self.doc = doc 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) if mo == 10: return 10 #that was easy diff --git a/pyfpdb/Hud.py b/pyfpdb/Hud.py index 38402f8f..60fc29be 100644 --- a/pyfpdb/Hud.py +++ b/pyfpdb/Hud.py @@ -455,6 +455,9 @@ class Hud: # Need range here, not xrange -> need the actual list adj = range(0, self.max + 1) # default seat adjustments = no adjustment # 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: try: 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) adj = self.adj_seats(hand, config) 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 for i in xrange(1, self.max + 1): diff --git a/pyfpdb/fpdb.py b/pyfpdb/fpdb.py index 0b3c4f4a..ad1798c2 100755 --- a/pyfpdb/fpdb.py +++ b/pyfpdb/fpdb.py @@ -513,10 +513,10 @@ class fpdb: # self.lock.release() 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" - #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() - # hide icon as it doesn't go away immediately in Windows - is this ok in Linux Eric? self.statusIcon.set_visible(False) gtk.main_quit()