From a944ba7cd3d66dceb6f622125e375a963dc24275 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 31 Oct 2009 20:06:16 -0400 Subject: [PATCH 1/5] comments edit --- pyfpdb/fpdb.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyfpdb/fpdb.py b/pyfpdb/fpdb.py index ef67749d..17720885 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() From 868a0b5bf03002d34497baa705d6ec698f40e4d0 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 31 Oct 2009 21:25:13 -0400 Subject: [PATCH 2/5] getting stud tourney to not crash import: fix call to storeHudCache in Database to use handStartTime rather than the undefined hand_start_time; stub out store_hands_players_stud_tourney as it looks like it was never updated to use current database setup. result: hud works, no longer crashes import, presumably does not store any hand info though. HHC base guessMaxSeats returns existing value of maxseats if some prior code has set it somewhere already --- pyfpdb/Database.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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)): From 64ee50223923a4a6ddeda6672399ac730ba54f5a Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 31 Oct 2009 21:25:27 -0400 Subject: [PATCH 3/5] here's the HHC patch i forgot to add on last commit --- pyfpdb/HandHistoryConverter.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 From cdc310dcb64fd285078e5eb9bd6cd903e9090866 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 1 Nov 2009 01:23:07 -0400 Subject: [PATCH 4/5] if HUD is told to create for a layout that doesn't exist in the config file, it will pick a 9 or 10 max layout and use it's positions, which you can then move the windows around, and save, and it should be saved in the right spot. --- pyfpdb/Hud.py | 7 +++++++ 1 file changed, 7 insertions(+) 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): From cb0c7430e691cd87f634a6985fad9f0e6977fede Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 1 Nov 2009 01:54:59 -0400 Subject: [PATCH 5/5] add comment at point in Configuration where we would need to add support for saving new table layouts. --- pyfpdb/Configuration.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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] ))