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

This commit is contained in:
Nikos Kouremenos 2006-04-10 23:28:53 +00:00
parent 5fcf9dca06
commit 213dcd32bb
1 changed files with 4 additions and 8 deletions

View File

@ -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')