From b3fb9e954df552b27cf3cd7cc7ad241f6df6e916 Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 28 Feb 2009 11:31:24 -0500 Subject: [PATCH 1/3] Fix clobber of db object. --- pyfpdb/GuiBulkImport.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/pyfpdb/GuiBulkImport.py b/pyfpdb/GuiBulkImport.py index 915e9a39..d61fa2df 100755 --- a/pyfpdb/GuiBulkImport.py +++ b/pyfpdb/GuiBulkImport.py @@ -194,16 +194,10 @@ class GuiBulkImport(): self.load_button.show() # see how many hands are in the db and adjust accordingly - db_parms = config.get_db_parameters('fpdb') - db.connect(db_parms['db-backend'], - db_parms['db-host'], - db_parms['db-databaseName'], - db_parms['db-user'], - db_parms['db-password']) - cursor = db.db.cursor() - cursor.execute("Select max(id) from Hands;") - row = cursor.fetchone() - db.disconnect() # that's all we need this for + tcursor = db.db.cursor() + tcursor.execute("Select max(id) from Hands;") + row = tcursor.fetchone() + tcursor.close() self.n_hands_in_db = row[0] if self.n_hands_in_db == 0: self.cb.set_active(2) From 5bf7d9038a39a6d9295749cfabdc30a525875158 Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 28 Feb 2009 15:19:01 -0500 Subject: [PATCH 2/3] Fix bug in autoclosing HUDs on windows. --- pyfpdb/Hud.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyfpdb/Hud.py b/pyfpdb/Hud.py index 73dd3472..d821e41e 100644 --- a/pyfpdb/Hud.py +++ b/pyfpdb/Hud.py @@ -142,7 +142,7 @@ class Hud: def update_table_position(self): if os.name == 'nt': if not win32gui.IsWindow(self.table.number): - self.kill_hud() + self.parent.kill_hud(self) return False # anyone know how to do this in unix, or better yet, trap the X11 error that is triggered when executing the get_origin() for a closed window? From 5ba8d3b95d647d073857f26b5019a5c3379e5676 Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 28 Feb 2009 18:46:54 -0500 Subject: [PATCH 3/3] Fix missing argument in call to kill_hud. --- pyfpdb/Hud.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyfpdb/Hud.py b/pyfpdb/Hud.py index d821e41e..ed43bea2 100644 --- a/pyfpdb/Hud.py +++ b/pyfpdb/Hud.py @@ -142,7 +142,7 @@ class Hud: def update_table_position(self): if os.name == 'nt': if not win32gui.IsWindow(self.table.number): - self.parent.kill_hud(self) + self.parent.kill_hud(self, self.table.name) return False # anyone know how to do this in unix, or better yet, trap the X11 error that is triggered when executing the get_origin() for a closed window?