Skip to content

Commit 87c8001

Browse files
committed
fix pylint issue
1 parent 18b886e commit 87c8001

File tree

1 file changed

+1
-61
lines changed

1 file changed

+1
-61
lines changed

src/class_sqlThread.py

Lines changed: 1 addition & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import paths
1616
import queues
1717
import state
18-
import tr
18+
from tr import _translate
1919
from addresses import encodeAddress
2020
from bmconfigparser import BMConfigParser
2121
from debug import logger
@@ -436,17 +436,6 @@ def earlier_setting_version(self, settingsversion):
436436
return 4
437437
return settingsversion
438438

439-
# def create_function(self):
440-
# """
441-
# Apply create_function to DB
442-
# """
443-
# try:
444-
# self.conn.create_function("enaddr", 3, func=encodeAddress, deterministic=True)
445-
# except (TypeError, sqlite3.NotSupportedError) as err:
446-
# logger.debug(
447-
# "Got error while pass deterministic in sqlite create function {}, Passing 3 params".format(err))
448-
# self.conn.create_function("enaddr", 3, encodeAddress)
449-
450439

451440
class sqlThread(threading.Thread, UpgradeDB):
452441
"""A thread for all SQL operations"""
@@ -511,54 +500,6 @@ def run(self): # pylint: disable=too-many-locals, too-many-branches, too-many-s
511500

512501
self.check_vaccumed()
513502

514-
# def initiate_database(self, cur=None, conn=None):
515-
# if not cur or not conn:
516-
# cur, conn = self.cur, self.conn
517-
# try:
518-
# cur.execute(
519-
# '''CREATE TABLE inbox (msgid blob, toaddress text, fromaddress text, subject text,'''
520-
# ''' received text, message text, folder text, encodingtype int, read bool, sighash blob,'''
521-
# ''' UNIQUE(msgid) ON CONFLICT REPLACE)''')
522-
# cur.execute(
523-
# '''CREATE TABLE sent (msgid blob, toaddress text, toripe blob, fromaddress text, subject text,'''
524-
# ''' message text, ackdata blob, senttime integer, lastactiontime integer,'''
525-
# ''' sleeptill integer, status text, retrynumber integer, folder text, encodingtype int, ttl int)''')
526-
# cur.execute(
527-
# '''CREATE TABLE subscriptions (label text, address text, enabled bool)''')
528-
# cur.execute(
529-
# '''CREATE TABLE addressbook (label text, address text, UNIQUE(address) ON CONFLICT IGNORE)''')
530-
# cur.execute(
531-
# '''CREATE TABLE blacklist (label text, address text, enabled bool)''')
532-
# cur.execute(
533-
# '''CREATE TABLE whitelist (label text, address text, enabled bool)''')
534-
# cur.execute(
535-
# '''CREATE TABLE pubkeys (address text, addressversion int, transmitdata blob, time int,'''
536-
# ''' usedpersonally text, UNIQUE(address) ON CONFLICT REPLACE)''')
537-
# cur.execute(
538-
# '''CREATE TABLE inventory (hash blob, objecttype int, streamnumber int, payload blob,'''
539-
# ''' expirestime integer, tag blob, UNIQUE(hash) ON CONFLICT REPLACE)''')
540-
# cur.execute(
541-
# '''INSERT INTO subscriptions VALUES'''
542-
# '''('Bitmessage new releases/announcements','BM-GtovgYdgs7qXPkoYaRgrLFuFKz1SFpsw',1)''')
543-
# cur.execute(
544-
# '''CREATE TABLE settings (key blob, value blob, UNIQUE(key) ON CONFLICT REPLACE)''')
545-
# cur.execute('''INSERT INTO settings VALUES('version','11')''')
546-
# cur.execute('''INSERT INTO settings VALUES('lastvacuumtime',?)''', (
547-
# int(time.time()),))
548-
# cur.execute(
549-
# '''CREATE TABLE objectprocessorqueue'''
550-
# ''' (objecttype int, data blob, UNIQUE(objecttype, data) ON CONFLICT REPLACE)''')
551-
# self.conn.commit()
552-
# logger.info('Created messages database file')
553-
# except Exception as err:
554-
# if str(err) == 'table inbox already exists':
555-
# logger.debug('Database file already exists.')
556-
#
557-
# else:
558-
# sys.stderr.write(
559-
# 'ERROR trying to create database file (message.dat). in1111 Error message: %s\n' % str(err))
560-
# os._exit(0)
561-
562503
def initiate_database(self, cur, conn):
563504
try:
564505
cur.execute(
@@ -605,7 +546,6 @@ def initiate_database(self, cur, conn):
605546
'ERROR trying to create database file (message.dat). in1111 Error message: %s\n' % str(err))
606547
os._exit(0)
607548

608-
609549
def create_function(self, conn):
610550
"""
611551
Apply create_function to DB

0 commit comments

Comments
 (0)