add new SeatSep display flag for filter, re-order some code with possible aim of using one function instead of 2 similar blocks of code for breakdown and totals

This commit is contained in:
sqlcoder 2009-05-10 23:06:35 +01:00
parent fe806ccea1
commit aba5b94847

View File

@ -52,6 +52,7 @@ class GuiPositionalStats (threading.Thread):
"Limits" : True, "Limits" : True,
"LimitSep" : True, "LimitSep" : True,
"Seats" : True, "Seats" : True,
"SeatSep" : True,
"Dates" : False, "Dates" : False,
"Button1" : True, "Button1" : True,
"Button2" : False "Button2" : False
@ -142,26 +143,35 @@ class GuiPositionalStats (threading.Thread):
self.createStatsTable(vbox, playerids, sitenos, limits, seats) self.createStatsTable(vbox, playerids, sitenos, limits, seats)
def createStatsTable(self, vbox, playerids, sitenos, limits, seats): def createStatsTable(self, vbox, playerids, sitenos, limits, seats):
tmp = self.sql.query['playerStatsByPosition']
tmp = self.refineQuery(tmp, playerids, sitenos, limits, seats)
self.cursor.execute(tmp)
result = self.cursor.fetchall()
self.stats_table = gtk.Table(1, 1, False) # gtk table expands as required self.stats_table = gtk.Table(1, 1, False) # gtk table expands as required
self.stats_table.set_col_spacings(4) self.stats_table.set_col_spacings(4)
self.stats_table.show() self.stats_table.show()
vbox.add(self.stats_table) vbox.add(self.stats_table)
colnames = [desc[0].lower() for desc in self.cursor.description] row = 0
rows = len(result)
col = 0 col = 0
row = 0
for t in self.posnheads: for t in self.posnheads:
l = gtk.Label(self.posnheads[col]) l = gtk.Label(self.posnheads[col])
l.show() l.show()
self.stats_table.attach(l, col, col+1, row, row+1, yoptions=gtk.SHRINK) self.stats_table.attach(l, col, col+1, row, row+1, yoptions=gtk.SHRINK)
col +=1 col +=1
tmp = self.sql.query['playerStatsByPosition']
tmp = self.refineQuery(tmp, playerids, sitenos, limits, seats)
self.cursor.execute(tmp)
result = self.cursor.fetchall()
rows = len(result)
colnames = [desc[0].lower() for desc in self.cursor.description]
last_game,last_seats,sqlrow = "","",0 last_game,last_seats,sqlrow = "","",0
while sqlrow < rows: while sqlrow < rows:
if(row%2 == 0): if(row%2 == 0):