mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-28 07:51:27 +00:00
wizard: (trivial) add some type hints
This commit is contained in:
parent
e6d43b60fa
commit
18c98483ac
2 changed files with 3 additions and 4 deletions
|
@ -144,7 +144,7 @@ class BaseWizard(Logger):
|
||||||
self.choice_dialog(title=title, message=message, choices=choices, run_next=self.on_wallet_type)
|
self.choice_dialog(title=title, message=message, choices=choices, run_next=self.on_wallet_type)
|
||||||
|
|
||||||
def upgrade_db(self, storage, db):
|
def upgrade_db(self, storage, db):
|
||||||
exc = None
|
exc = None # type: Optional[Exception]
|
||||||
def on_finished():
|
def on_finished():
|
||||||
if exc is None:
|
if exc is None:
|
||||||
self.terminate(storage=storage, db=db)
|
self.terminate(storage=storage, db=db)
|
||||||
|
|
|
@ -31,6 +31,7 @@ from electrum.plugin import run_hook, Plugins
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from electrum.simple_config import SimpleConfig
|
from electrum.simple_config import SimpleConfig
|
||||||
|
from electrum.wallet_db import WalletDB
|
||||||
from . import ElectrumGui
|
from . import ElectrumGui
|
||||||
|
|
||||||
|
|
||||||
|
@ -321,7 +322,7 @@ class InstallWizard(QDialog, MessageBoxMixin, BaseWizard):
|
||||||
|
|
||||||
return temp_storage.path, (temp_storage if temp_storage.file_exists() else None)
|
return temp_storage.path, (temp_storage if temp_storage.file_exists() else None)
|
||||||
|
|
||||||
def run_upgrades(self, storage, db):
|
def run_upgrades(self, storage: WalletStorage, db: 'WalletDB') -> None:
|
||||||
path = storage.path
|
path = storage.path
|
||||||
if db.requires_split():
|
if db.requires_split():
|
||||||
self.hide()
|
self.hide()
|
||||||
|
@ -360,8 +361,6 @@ class InstallWizard(QDialog, MessageBoxMixin, BaseWizard):
|
||||||
if db.requires_upgrade():
|
if db.requires_upgrade():
|
||||||
self.upgrade_db(storage, db)
|
self.upgrade_db(storage, db)
|
||||||
|
|
||||||
return db
|
|
||||||
|
|
||||||
def on_error(self, exc_info):
|
def on_error(self, exc_info):
|
||||||
if not isinstance(exc_info[1], UserCancelled):
|
if not isinstance(exc_info[1], UserCancelled):
|
||||||
self.logger.error("on_error", exc_info=exc_info)
|
self.logger.error("on_error", exc_info=exc_info)
|
||||||
|
|
Loading…
Add table
Reference in a new issue