From 9ca400b4abbe63f5de84bec74311a55d092004de Mon Sep 17 00:00:00 2001 From: steffen123 Date: Wed, 6 Aug 2008 21:57:02 +0100 Subject: [PATCH] git13 - tv now displays the data over a range of activeSeats. see table_viewer.py lines 75-84 for ranges. added version string to GUI made GUI a bit wider to accomodate wider t --- docs/known-bugs-and-planned-features.txt | 1 + pyfpdb/fpdb.py | 4 +-- pyfpdb/table_viewer.py | 32 ++++++++++++++++++++++-- 3 files changed, 33 insertions(+), 4 deletions(-) diff --git a/docs/known-bugs-and-planned-features.txt b/docs/known-bugs-and-planned-features.txt index 86bafb1a..be64ebaf 100644 --- a/docs/known-bugs-and-planned-features.txt +++ b/docs/known-bugs-and-planned-features.txt @@ -86,6 +86,7 @@ benchmark properly on mysql innodb, mysql myisam, postgresql, sqlite, more? rename things like this: ClassName.methodName and variableName. do this on tables too. update codingstyle CLI (not ncurses, proper CLI) equivalent for fpdb.py optimise/simplify storing by creating the SQL statements depending on hand rather than calling different methods +make range of activeSeats configurable for tv/hud License ======= diff --git a/pyfpdb/fpdb.py b/pyfpdb/fpdb.py index e4d2458b..30f306a0 100755 --- a/pyfpdb/fpdb.py +++ b/pyfpdb/fpdb.py @@ -343,9 +343,9 @@ blabla""") self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) self.window.connect("delete_event", self.delete_event) self.window.connect("destroy", self.destroy) - self.window.set_title("Free Poker DB - version: pre-alpha, git12") + self.window.set_title("Free Poker DB - version: pre-alpha, git13") self.window.set_border_width(1) - self.window.set_size_request(600,400) + self.window.set_size_request(700,400) self.window.set_resizable(True) self.menu_items = ( diff --git a/pyfpdb/table_viewer.py b/pyfpdb/table_viewer.py index 596fd11a..958dddea 100755 --- a/pyfpdb/table_viewer.py +++ b/pyfpdb/table_viewer.py @@ -71,8 +71,36 @@ class table_viewer (threading.Thread): tmp=[] tmp.append(self.player_names[player][0]) - self.cursor.execute("SELECT * FROM HudDataHoldemOmaha WHERE gametypeId=%s AND playerId=%s AND activeSeats=%s", (self.gametype_id, self.player_ids[player][0], len(self.player_names))) - row=self.cursor.fetchone() + seatCount=len(self.player_names) + if seatCount>=8: + minSeats,maxSeats=7,10 + elif seatCount==7: + minSeats,maxSeats=6,9 + elif seatCount==6 or seatCount==5: + minSeats,maxSeats=seatCount-1,seatCount+1 + elif seatCount==4: + minSeats,maxSeats=4,5 + elif seatCount==2 or seatCount==3: + minSeats,maxSeats=seatCount,seatCount + else: + fpdb_simple.FpdbError("invalid seatCount") + + self.cursor.execute("SELECT * FROM HudDataHoldemOmaha WHERE gametypeId=%s AND playerId=%s AND activeSeats>=%s AND activeSeats<=%s", (self.gametype_id, self.player_ids[player][0], minSeats, maxSeats)) + rows=self.cursor.fetchall() + + row=[] + for field_no in range(len(rows[0])): + row.append(rows[0][field_no]) + + for row_no in range(len(rows)): + if row_no==0: + pass + else: + for field_no in range(len(rows[row_no])): + if field_no<=3: + pass + else: + row[field_no]+=rows[row_no][field_no] tmp.append(str(row[4]))#Hands tmp.append(self.hudDivide(row[5],row[4])) #VPIP