'''INSERT INTO pubkeys SELECT address, addressversion, transmitdata, time, usedpersonally FROM pubkeys_backup;''')
self.cur.execute('''DROP TABLE pubkeys_backup''')
logger.debug('In messages.dat database, done adding address field to the pubkeys table and removing the hash field.')
'''INSERT INTO pubkeys SELECT'''
''' address, addressversion, transmitdata, time, usedpersonally FROM pubkeys_backup;''')
self.cur.execute('''DROP TABLE pubkeys_backup''')
logger.debug(
'In messages.dat database, done adding address field to the pubkeys table'
' and removing the hash field.')
self.cur.execute('''update settings set value=10 WHERE key='version';''')
# Are you hoping to add a new option to the keys.dat file of existing
@ -355,7 +398,7 @@ class sqlThread(threading.Thread):
try:
testpayload='\x00\x00'
t=('1234',1,testpayload,'12345678','no')
self.cur.execute('''INSERT INTO pubkeys VALUES(?,?,?,?,?)''',t)
self.cur.execute('''INSERT INTO pubkeys VALUES(?,?,?,?,?)''',t)
self.conn.commit()
self.cur.execute(
'''SELECT transmitdata FROM pubkeys WHERE address='1234'''')
@ -365,13 +408,29 @@ class sqlThread(threading.Thread):
self.cur.execute('''DELETE FROM pubkeys WHERE address='1234'''')
self.conn.commit()
iftransmitdata=='':
logger.fatal('Problem: The version of SQLite you have cannot store Null values. Please download and install the latest revision of your version of Python (for example, the latest Python 2.7 revision) and try again.\n')
logger.fatal('PyBitmessage will now exit very abruptly. You may now see threading errors related to this abrupt exit but the problem you need to solve is related to SQLite.\n\n')
logger.fatal(
'Problem: The version of SQLite you have cannot store Null values.'
' Please download and install the latest revision of your version of Python'
' (for example, the latest Python 2.7 revision) and try again.\n')
logger.fatal(
'PyBitmessage will now exit very abruptly.'
' You may now see threading errors related to this abrupt exit'
' but the problem you need to solve is related to SQLite.\n\n')
os._exit(0)
exceptExceptionaserr:
ifstr(err)=='database or disk is full':
logger.fatal('(While null value test) Alert: Your disk or data storage volume is full. sqlThread will now exit.')
queues.UISignalQueue.put(('alert',(tr._translate("MainWindow","Disk full"),tr._translate("MainWindow",'Alert: Your disk or data storage volume is full. Bitmessage will now exit.'),True)))
logger.fatal(
'(While null value test) Alert: Your disk or data storage volume is full.'
' sqlThread will now exit.')
queues.UISignalQueue.put((
'alert',(
tr._translate(
"MainWindow",
"Disk full"),
tr._translate(
"MainWindow",
'Alert: Your disk or data storage volume is full. Bitmessage will now exit.'),
True)))
os._exit(0)
else:
logger.error(err)
@ -387,11 +446,21 @@ class sqlThread(threading.Thread):
ifint(value)<int(time.time())-86400:
logger.info('It has been a long time since the messages.dat file has been vacuumed. Vacuuming now...')
try:
self.cur.execute(''' VACUUM ''')
self.cur.execute(''' VACUUM ''')
exceptExceptionaserr:
ifstr(err)=='database or disk is full':
logger.fatal('(While VACUUM) Alert: Your disk or data storage volume is full. sqlThread will now exit.')
queues.UISignalQueue.put(('alert',(tr._translate("MainWindow","Disk full"),tr._translate("MainWindow",'Alert: Your disk or data storage volume is full. Bitmessage will now exit.'),True)))
logger.fatal(
'(While VACUUM) Alert: Your disk or data storage volume is full.'
' sqlThread will now exit.')
queues.UISignalQueue.put((
'alert',(
tr._translate(
"MainWindow",
"Disk full"),
tr._translate(
"MainWindow",
'Alert: Your disk or data storage volume is full. Bitmessage will now exit.'),
True)))
os._exit(0)
item='''update settings set value=? WHERE key='lastvacuumtime';'''
parameters=(int(time.time()),)
@ -406,8 +475,18 @@ class sqlThread(threading.Thread):
self.conn.commit()
exceptExceptionaserr:
ifstr(err)=='database or disk is full':
logger.fatal('(While committing) Alert: Your disk or data storage volume is full. sqlThread will now exit.')
queues.UISignalQueue.put(('alert',(tr._translate("MainWindow","Disk full"),tr._translate("MainWindow",'Alert: Your disk or data storage volume is full. Bitmessage will now exit.'),True)))
logger.fatal(
'(While committing) Alert: Your disk or data storage volume is full.'
' sqlThread will now exit.')
queues.UISignalQueue.put((
'alert',(
tr._translate(
"MainWindow",
"Disk full"),
tr._translate(
"MainWindow",
'Alert: Your disk or data storage volume is full. Bitmessage will now exit.'),
True)))
os._exit(0)
elifitem=='exit':
self.conn.close()
@ -421,8 +500,18 @@ class sqlThread(threading.Thread):
self.conn.commit()
exceptExceptionaserr:
ifstr(err)=='database or disk is full':
logger.fatal('(while movemessagstoprog) Alert: Your disk or data storage volume is full. sqlThread will now exit.')
queues.UISignalQueue.put(('alert',(tr._translate("MainWindow","Disk full"),tr._translate("MainWindow",'Alert: Your disk or data storage volume is full. Bitmessage will now exit.'),True)))
logger.fatal(
'(while movemessagstoprog) Alert: Your disk or data storage volume is full.'
' sqlThread will now exit.')
queues.UISignalQueue.put((
'alert',(
tr._translate(
"MainWindow",
"Disk full"),
tr._translate(
"MainWindow",
'Alert: Your disk or data storage volume is full. Bitmessage will now exit.'),
True)))
os._exit(0)
self.conn.close()
shutil.move(
@ -437,8 +526,18 @@ class sqlThread(threading.Thread):
self.conn.commit()
exceptExceptionaserr:
ifstr(err)=='database or disk is full':
logger.fatal('(while movemessagstoappdata) Alert: Your disk or data storage volume is full. sqlThread will now exit.')
queues.UISignalQueue.put(('alert',(tr._translate("MainWindow","Disk full"),tr._translate("MainWindow",'Alert: Your disk or data storage volume is full. Bitmessage will now exit.'),True)))
logger.fatal(
'(while movemessagstoappdata) Alert: Your disk or data storage volume is full.'
' sqlThread will now exit.')
queues.UISignalQueue.put((
'alert',(
tr._translate(
"MainWindow",
"Disk full"),
tr._translate(
"MainWindow",
'Alert: Your disk or data storage volume is full. Bitmessage will now exit.'),
True)))
os._exit(0)
self.conn.close()
shutil.move(
@ -451,11 +550,21 @@ class sqlThread(threading.Thread):
self.cur.execute('''delete from sent where folder='trash'''')
self.conn.commit()
try:
self.cur.execute(''' VACUUM ''')
self.cur.execute(''' VACUUM ''')
exceptExceptionaserr:
ifstr(err)=='database or disk is full':
logger.fatal('(while deleteandvacuume) Alert: Your disk or data storage volume is full. sqlThread will now exit.')
queues.UISignalQueue.put(('alert',(tr._translate("MainWindow","Disk full"),tr._translate("MainWindow",'Alert: Your disk or data storage volume is full. Bitmessage will now exit.'),True)))
logger.fatal(
'(while deleteandvacuume) Alert: Your disk or data storage volume is full.'
' sqlThread will now exit.')
queues.UISignalQueue.put((
'alert',(
tr._translate(
"MainWindow",
"Disk full"),
tr._translate(
"MainWindow",
'Alert: Your disk or data storage volume is full. Bitmessage will now exit.'),
True)))
os._exit(0)
else:
parameters=helper_sql.sqlSubmitQueue.get()
@ -467,11 +576,30 @@ class sqlThread(threading.Thread):
rowcount=self.cur.rowcount
exceptExceptionaserr:
ifstr(err)=='database or disk is full':
logger.fatal('(while cur.execute) Alert: Your disk or data storage volume is full. sqlThread will now exit.')
queues.UISignalQueue.put(('alert',(tr._translate("MainWindow","Disk full"),tr._translate("MainWindow",'Alert: Your disk or data storage volume is full. Bitmessage will now exit.'),True)))
logger.fatal(
'(while cur.execute) Alert: Your disk or data storage volume is full.'
' sqlThread will now exit.')
queues.UISignalQueue.put((
'alert',(
tr._translate(
"MainWindow",
"Disk full"),
tr._translate(
"MainWindow",
'Alert: Your disk or data storage volume is full. Bitmessage will now exit.'),
True)))
os._exit(0)
else:
logger.fatal('Major error occurred when trying to execute a SQL statement within the sqlThread. Please tell Atheros about this error message or post it in the forum! Error occurred while trying to execute statement: "%s" Here are the parameters; you might want to censor this data with asterisks (***) as it can contain private information: %s. Here is the actual error message thrown by the sqlThread: %s',str(item),str(repr(parameters)),str(err))
logger.fatal(
'Major error occurred when trying to execute a SQL statement within the sqlThread.'
' Please tell Atheros about this error message or post it in the forum!'
' Error occurred while trying to execute statement: "%s" Here are the parameters;'
' you might want to censor this data with asterisks (***)'
' as it can contain private information: %s.'
' Here is the actual error message thrown by the sqlThread: %s',
str(item),
str(repr(parameters)),
str(err))
logger.fatal('This program shall now abruptly exit!')