db logs and some fixes
This commit is contained in:
parent
4c6205cc39
commit
f782b99402
3 changed files with 9 additions and 3 deletions
|
@ -76,6 +76,7 @@ class History:
|
|||
')')
|
||||
db.commit()
|
||||
except:
|
||||
print('Database is locked!')
|
||||
db.rollback()
|
||||
finally:
|
||||
db.close()
|
||||
|
@ -89,6 +90,7 @@ class History:
|
|||
cursor.execute('DROP TABLE id' + tox_id + ';')
|
||||
db.commit()
|
||||
except:
|
||||
print('Database is locked!')
|
||||
db.rollback()
|
||||
finally:
|
||||
db.close()
|
||||
|
@ -111,6 +113,7 @@ class History:
|
|||
'VALUES (?, ?, ?, ?);', messages_iter)
|
||||
db.commit()
|
||||
except:
|
||||
print('Database is locked!')
|
||||
db.rollback()
|
||||
finally:
|
||||
db.close()
|
||||
|
@ -124,6 +127,7 @@ class History:
|
|||
'WHERE unix_time < ' + str(unsent_time) + ' AND owner = 2;')
|
||||
db.commit()
|
||||
except:
|
||||
print('Database is locked!')
|
||||
db.rollback()
|
||||
finally:
|
||||
db.close()
|
||||
|
@ -137,6 +141,7 @@ class History:
|
|||
cursor.execute('DELETE FROM id' + tox_id + ' WHERE unix_time = ' + str(time) + ';')
|
||||
db.commit()
|
||||
except:
|
||||
print('Database is locked!')
|
||||
db.rollback()
|
||||
finally:
|
||||
db.close()
|
||||
|
@ -149,6 +154,7 @@ class History:
|
|||
cursor.execute('DELETE FROM id' + tox_id + ';')
|
||||
db.commit()
|
||||
except:
|
||||
print('Database is locked!')
|
||||
db.rollback()
|
||||
finally:
|
||||
db.close()
|
||||
|
@ -202,4 +208,5 @@ class History:
|
|||
self._cursor.fetchmany(self._count)
|
||||
|
||||
def delete_one(self):
|
||||
if self._count:
|
||||
self._count -= 1
|
||||
|
|
|
@ -263,7 +263,6 @@ class MainWindow(QtGui.QMainWindow, Singleton):
|
|||
self.messages.setGeometry(0, 0, 620, 310)
|
||||
self.messages.setObjectName("messages")
|
||||
self.messages.setSpacing(1)
|
||||
|
||||
self.messages.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn)
|
||||
self.messages.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
|
||||
self.messages.focusOutEvent = lambda event: self.messages.clearSelection()
|
||||
|
|
|
@ -3,7 +3,7 @@ import settings
|
|||
import platform
|
||||
try:
|
||||
from PySide import QtNetwork, QtCore
|
||||
except:
|
||||
except ImportError:
|
||||
from PyQt4 import QtNetwork, QtCore
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue