From 213dcd32bbe000c889b5d2e866387d8cd26b0ad0 Mon Sep 17 00:00:00 2001 From: Nikos Kouremenos Date: Mon, 10 Apr 2006 23:28:53 +0000 Subject: [PATCH] put back IF NOT as currently we always try to create and TB. first we wait for info in ticket. then if needed we ask db to list table and perhaps parse it or find a way to test table is there (rather than everything catching --- src/common/check_paths.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/common/check_paths.py b/src/common/check_paths.py index cb21e11bc..39f3a0d36 100644 --- a/src/common/check_paths.py +++ b/src/common/check_paths.py @@ -36,22 +36,18 @@ Q_ = i18n.Q_ from pysqlite2 import dbapi2 as sqlite # DO NOT MOVE ABOVE OF import gajim def assert_unread_msgs_table_exists(): - ''' create table unread_messages if there is no such table ''' + '''create table unread_messages if there is no such table''' con = sqlite.connect(logger.LOG_DB_PATH) cur = con.cursor() cur.executescript( ''' - CREATE TABLE unread_messages ( + CREATE TABLE IF NOT EXISTS unread_messages ( message_id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE ); ''' ) - try: - con.commit() - gajim.logger.init_vars() - except sqlite.OperationalError, e: - pass - con.close() + con.commit() + gajim.logger.init_vars() # FIXME: is this needed? def create_log_db(): print _('creating logs database')