From 1640ab3cfc3a4dee204e9e5180aa587c9464810d Mon Sep 17 00:00:00 2001 From: sqlcoder Date: Mon, 17 Aug 2009 21:51:13 +0100 Subject: [PATCH 1/4] attempt to stop a KeyError problem (problem patching up the symptoms rather than fixing the cause) --- pyfpdb/Mucked.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyfpdb/Mucked.py b/pyfpdb/Mucked.py index 3bd84cb7..c059c703 100755 --- a/pyfpdb/Mucked.py +++ b/pyfpdb/Mucked.py @@ -450,7 +450,9 @@ class Flop_Mucked(Aux_Seats): self.displayed = True if i != "common": id = self.get_id_from_seat(i) - self.m_windows[i].eb.set_tooltip_text(self.hud.stat_dict[id]['screen_name']) + # sc: had KeyError here with new table so added id != None test as a guess: + if id != None: + self.m_windows[i].eb.set_tooltip_text(self.hud.stat_dict[id]['screen_name']) def update_gui(self, new_hand_id): """Prepare and show the mucked cards.""" From b0677545e03890d87914711c3bf6f4b09a54beef Mon Sep 17 00:00:00 2001 From: sqlcoder Date: Tue, 22 Sep 2009 21:54:01 +0100 Subject: [PATCH 2/4] remove UNSIGNED from postgres create table statement --- pyfpdb/SQL.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyfpdb/SQL.py b/pyfpdb/SQL.py index c8639fbc..986f9762 100644 --- a/pyfpdb/SQL.py +++ b/pyfpdb/SQL.py @@ -400,7 +400,7 @@ class Sql: endTime timestamp without time zone, buyinChips INT, tourneyName varchar(40), - matrixIdProcessed SMALLINT UNSIGNED DEFAULT 0, /* Mask use : 1=Positionnal Winnings|2=Match1|4=Match2|...|pow(2,n)=Matchn */ + matrixIdProcessed SMALLINT DEFAULT 0, /* Mask use : 1=Positionnal Winnings|2=Match1|4=Match2|...|pow(2,n)=Matchn */ rebuyChips INT DEFAULT 0, addonChips INT DEFAULT 0, rebuyAmount INT DEFAULT 0, From 455e92e6f6b7ae599257e5f91598851508716c75 Mon Sep 17 00:00:00 2001 From: sqlcoder Date: Tue, 22 Sep 2009 22:04:05 +0100 Subject: [PATCH 3/4] fix tourneytypes insert for postgres --- pyfpdb/Database.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index f4de8169..87d178b3 100755 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -1015,7 +1015,9 @@ class Database: if self.backend == self.SQLITE: c.execute("INSERT INTO TourneyTypes (id, siteId, buyin, fee) VALUES (NULL, 1, 0, 0);") else: - c.execute("insert into TourneyTypes values (0,1,0,0,0,0,0,null,0,0,0);") + c.execute("""insert into TourneyTypes(id, siteId, buyin, fee, maxSeats, knockout + ,rebuyOrAddon, speed, headsUp, shootout, matrix) + values (0, 1, 0, 0, 0, False, False, null, False, False, False);""") #end def fillDefaultData From e080ec3fd1f1b2aaf64b56546c906816b1a1f15c Mon Sep 17 00:00:00 2001 From: sqlcoder Date: Tue, 22 Sep 2009 22:08:42 +0100 Subject: [PATCH 4/4] further fix to tourneytypes insert for postgres --- pyfpdb/Database.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index 87d178b3..9c506afa 100755 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -1017,7 +1017,7 @@ class Database: else: c.execute("""insert into TourneyTypes(id, siteId, buyin, fee, maxSeats, knockout ,rebuyOrAddon, speed, headsUp, shootout, matrix) - values (0, 1, 0, 0, 0, False, False, null, False, False, False);""") + values (1, 1, 0, 0, 0, False, False, null, False, False, False);""") #end def fillDefaultData