proper inherit remove return from __init__

This commit is contained in:
Muzahid 2021-02-06 20:03:48 +05:30
parent 31c5e4ff38
commit 583e5910fe
Signed by untrusted user: cis-muzahid
GPG Key ID: 1DC85E7D3AB613EA

View File

@ -23,9 +23,13 @@ from debug import logger
class UpgradeDB(): class UpgradeDB():
"""Upgrade Db with respect to versions""" """Upgrade Db with respect to versions"""
def __init__(self, cur, version): def __init__(self):
""" Apply switcher to call methods accordingly """ """ Apply switcher to call methods accordingly """
self.cur = None
self.parameters = ""
def switcher(self, cur, version):
""" Apply switcher to call methods accordingly """
self.cur = cur self.cur = cur
self.parameters = "" self.parameters = ""
@ -439,7 +443,7 @@ class sqlThread(threading.Thread, UpgradeDB):
self.cur.execute(item, parameters) self.cur.execute(item, parameters)
currentVersion = int(self.cur.fetchall()[0][0]) currentVersion = int(self.cur.fetchall()[0][0])
# Call upgrade class for upgrade DB # Call upgrade class for upgrade DB
UpgradeDB(self.cur, currentVersion) self.switcher(self.cur, currentVersion)
# Are you hoping to add a new option to the keys.dat file of existing # Are you hoping to add a new option to the keys.dat file of existing
# Bitmessage users or modify the SQLite database? Add it right # Bitmessage users or modify the SQLite database? Add it right