handle player not found

This commit is contained in:
steffen123 2010-08-10 00:49:14 +02:00
parent 10fac81ef9
commit 08451c77d5

View File

@ -88,23 +88,28 @@ class GuiTourneyViewer (threading.Thread):
def displayPlayerClicked(self, widget, data=None): def displayPlayerClicked(self, widget, data=None):
if self.prepare(4, 5): if self.prepare(4, 5):
result=self.db.getTourneyPlayerInfo(self.siteName, self.tourneyNo, self.playerName) result=self.db.getTourneyPlayerInfo(self.siteName, self.tourneyNo, self.playerName)
x=0 if result[1] == None:
y=0 self.table.destroy()
for i in range(1,len(result[0])): self.errorLabel=gtk.Label("Player or tourney not found - please ensure you imported it and selected the correct site")
if y==5: self.mainVBox.add(self.errorLabel)
x+=2 else:
y=0 x=0
y=0
label=gtk.Label(result[0][i]) for i in range(1,len(result[0])):
self.table.attach(label,x,x+1,y,y+1) if y==5:
x+=2
if result[1][i]==None: y=0
label=gtk.Label("N/A")
else: label=gtk.Label(result[0][i])
label=gtk.Label(result[1][i]) self.table.attach(label,x,x+1,y,y+1)
self.table.attach(label,x+1,x+2,y,y+1)
if result[1][i]==None:
y+=1 label=gtk.Label("N/A")
else:
label=gtk.Label(result[1][i])
self.table.attach(label,x+1,x+2,y,y+1)
y+=1
self.mainVBox.show_all() self.mainVBox.show_all()
#def displayPlayerClicked #def displayPlayerClicked