fix um again; fix coding standrads (crazy tabbing, bad spacing before comma)
This commit is contained in:
parent
764b08924e
commit
5fcf9dca06
|
@ -35,17 +35,17 @@ Q_ = i18n.Q_
|
||||||
|
|
||||||
from pysqlite2 import dbapi2 as sqlite # DO NOT MOVE ABOVE OF import gajim
|
from pysqlite2 import dbapi2 as sqlite # DO NOT MOVE ABOVE OF import gajim
|
||||||
|
|
||||||
def assert_um_exists():
|
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)
|
con = sqlite.connect(logger.LOG_DB_PATH)
|
||||||
cur = con.cursor()
|
cur = con.cursor()
|
||||||
cur.executescript(
|
cur.executescript(
|
||||||
'''
|
'''
|
||||||
CREATE TABLE unread_messages (
|
CREATE TABLE unread_messages (
|
||||||
message_id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE
|
message_id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE
|
||||||
);
|
);
|
||||||
'''
|
'''
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
con.commit()
|
con.commit()
|
||||||
gajim.logger.init_vars()
|
gajim.logger.init_vars()
|
||||||
|
@ -128,7 +128,7 @@ def check_and_possibly_create_paths():
|
||||||
print _('Gajim will now exit')
|
print _('Gajim will now exit')
|
||||||
sys.exit()
|
sys.exit()
|
||||||
else:
|
else:
|
||||||
assert_um_exists()
|
assert_unread_msgs_table_exists()
|
||||||
|
|
||||||
else: # dot_gajim doesn't exist
|
else: # dot_gajim doesn't exist
|
||||||
if dot_gajim: # is '' on win9x so avoid that
|
if dot_gajim: # is '' on win9x so avoid that
|
||||||
|
|
|
@ -235,7 +235,7 @@ class Logger:
|
||||||
jid = jid.lower()
|
jid = jid.lower()
|
||||||
jid_id = self.get_jid_id(jid)
|
jid_id = self.get_jid_id(jid)
|
||||||
self.cur.execute('''
|
self.cur.execute('''
|
||||||
SELECT message_id, message, time, subject FROM logs , unread_messages
|
SELECT message_id, message, time, subject FROM logs, unread_messages
|
||||||
WHERE jid_id = %d AND log_line_id = message_id ORDER BY time ASC
|
WHERE jid_id = %d AND log_line_id = message_id ORDER BY time ASC
|
||||||
''' % (jid_id)
|
''' % (jid_id)
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue