Fix clobber of db object.

This commit is contained in:
Ray 2009-02-28 11:31:24 -05:00
parent d44c90aec7
commit b3fb9e954d

View File

@ -194,16 +194,10 @@ class GuiBulkImport():
self.load_button.show() self.load_button.show()
# see how many hands are in the db and adjust accordingly # see how many hands are in the db and adjust accordingly
db_parms = config.get_db_parameters('fpdb') tcursor = db.db.cursor()
db.connect(db_parms['db-backend'], tcursor.execute("Select max(id) from Hands;")
db_parms['db-host'], row = tcursor.fetchone()
db_parms['db-databaseName'], tcursor.close()
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
self.n_hands_in_db = row[0] self.n_hands_in_db = row[0]
if self.n_hands_in_db == 0: if self.n_hands_in_db == 0:
self.cb.set_active(2) self.cb.set_active(2)