Philipp Hörist pushed to branch master at gajim / gajim

Commits:

2 changed files:

Changes:

  • gajim/common/logger.py
    ... ... @@ -676,7 +676,7 @@ class Logger:
    676 676
     
    
    677 677
             try:
    
    678 678
                 messages = self.con.execute(
    
    679
    -                sql, (*jids, restore, pending)).fetchall()
    
    679
    +                sql, tuple(jids) + (restore, pending)).fetchall()
    
    680 680
             except sqlite.DatabaseError:
    
    681 681
                 self.dispatch('DB_ERROR',
    
    682 682
                               exceptions.DatabaseMalformed(LOG_DB_PATH))
    
    ... ... @@ -722,8 +722,8 @@ class Logger:
    722 722
                 ORDER BY time, log_line_id
    
    723 723
                 '''.format(jids=', '.join('?' * len(jids)))
    
    724 724
     
    
    725
    -        return self.con.execute(sql, (*jids, 
    
    726
    -                                      date.timestamp(),
    
    725
    +        return self.con.execute(sql, tuple(jids) +
    
    726
    +                                      (date.timestamp(),
    
    727 727
                                           (date + delta).timestamp())).fetchall()
    
    728 728
     
    
    729 729
         def search_log(self, account, jid, query, date=None):
    
    ... ... @@ -765,7 +765,7 @@ class Logger:
    765 765
             '''.format(jids=', '.join('?' * len(jids)),
    
    766 766
                        date_search=between if date else '')
    
    767 767
     
    
    768
    -        return self.con.execute(sql, (*jids, query)).fetchall()
    
    768
    +        return self.con.execute(sql, tuple(jids) + (query,)).fetchall()
    
    769 769
     
    
    770 770
         def get_days_with_logs(self, account, jid, year, month):
    
    771 771
             """
    
    ... ... @@ -803,8 +803,8 @@ class Logger:
    803 803
                 """.format(jids=', '.join('?' * len(jids)),
    
    804 804
                            kinds=', '.join(kinds))
    
    805 805
     
    
    806
    -        return self.con.execute(sql, (*jids,
    
    807
    -                                      date.timestamp(),
    
    806
    +        return self.con.execute(sql, tuple(jids) +
    
    807
    +                                      (date.timestamp(),
    
    808 808
                                           (date + delta).timestamp())).fetchall()
    
    809 809
     
    
    810 810
         def get_last_date_that_has_logs(self, account, jid):
    
    ... ... @@ -831,7 +831,7 @@ class Logger:
    831 831
     
    
    832 832
             # fetchone() returns always at least one Row with all
    
    833 833
             # attributes set to None because of the MAX() function
    
    834
    -        return self.con.execute(sql, (*jids,)).fetchone().time
    
    834
    +        return self.con.execute(sql, tuple(jids)).fetchone().time
    
    835 835
     
    
    836 836
         def get_room_last_message_time(self, account, jid):
    
    837 837
             """
    
    ... ... @@ -1210,7 +1210,7 @@ class Logger:
    1210 1210
                   '''.format(columns=', '.join(kwargs.keys()),
    
    1211 1211
                              values=', '.join('?' * len(kwargs)))
    
    1212 1212
     
    
    1213
    -        lastrowid = self.con.execute(sql, (jid, time_, kind, *kwargs.values())).lastrowid
    
    1213
    +        lastrowid = self.con.execute(sql, (jid, time_, kind) + tuple(kwargs.values())).lastrowid
    
    1214 1214
     
    
    1215 1215
             if unread and kind == KindConstant.CHAT_MSG_RECV:
    
    1216 1216
                 sql = '''INSERT INTO unread_messages (message_id, jid_id)
    

  • gajim/emoticons.py
    ... ... @@ -20,6 +20,7 @@ import sys
    20 20
     import logging
    
    21 21
     import importlib.util as imp
    
    22 22
     from collections import OrderedDict
    
    23
    +from importlib.machinery import SourceFileLoader
    
    23 24
     
    
    24 25
     from gi.repository import GdkPixbuf, Gtk, GLib
    
    25 26
     
    
    ... ... @@ -65,10 +66,9 @@ def load(path):
    65 66
             module_name = 'emoticons_theme.pyc'
    
    66 67
             theme_path = os.path.join(path, module_name)
    
    67 68
     
    
    68
    -    spec = imp.spec_from_file_location(module_name, theme_path)
    
    69
    +    loader = SourceFileLoader(module_name, theme_path)
    
    69 70
         try:
    
    70
    -        theme = imp.module_from_spec(spec)
    
    71
    -        spec.loader.exec_module(theme)
    
    71
    +        theme = loader.load_module()
    
    72 72
         except FileNotFoundError:
    
    73 73
             log.exception('Emoticons theme not found')
    
    74 74
             return