1
0

wizard: imports, flake

This commit is contained in:
Sander van Grieken
2023-08-01 14:59:58 +02:00
parent a6aff1ec07
commit c99f71aefc
3 changed files with 18 additions and 5 deletions

View File

@@ -1,13 +1,16 @@
from PyQt5.QtCore import pyqtProperty, pyqtSignal, pyqtSlot, QObject from typing import TYPE_CHECKING
from PyQt5.QtWidgets import QApplication, QVBoxLayout, QWidget
from PyQt5.QtWidgets import QApplication
from electrum.i18n import _ from electrum.i18n import _
from .wizard import QEAbstractWizard, WizardComponent from .wizard import QEAbstractWizard, WizardComponent
from electrum.logging import get_logger
from electrum.wizard import ServerConnectWizard from electrum.wizard import ServerConnectWizard
from ..network_dialog import ProxyWidget, ServerWidget from ..network_dialog import ProxyWidget, ServerWidget
from ..util import ChoicesLayout from ..util import ChoicesLayout
if TYPE_CHECKING:
from electrum.simple_config import SimpleConfig
class QEServerConnectWizard(ServerConnectWizard, QEAbstractWizard): class QEServerConnectWizard(ServerConnectWizard, QEAbstractWizard):

View File

@@ -1,4 +1,5 @@
import os import os
from typing import TYPE_CHECKING
from PyQt5.QtCore import Qt, QTimer, QRect from PyQt5.QtCore import Qt, QTimer, QRect
from PyQt5.QtGui import QPen, QPainter, QPalette from PyQt5.QtGui import QPen, QPainter, QPalette
@@ -21,6 +22,9 @@ from ..password_dialog import PasswordLayout, PW_NEW, MSG_ENTER_PASSWORD
from ..seed_dialog import SeedLayout, MSG_PASSPHRASE_WARN_ISSUE4566, KeysLayout from ..seed_dialog import SeedLayout, MSG_PASSPHRASE_WARN_ISSUE4566, KeysLayout
from ..util import ChoicesLayout, PasswordLineEdit, char_width_in_lineedit, WWLabel, InfoButton, font_height from ..util import ChoicesLayout, PasswordLineEdit, char_width_in_lineedit, WWLabel, InfoButton, font_height
if TYPE_CHECKING:
from electrum.simple_config import SimpleConfig
WIF_HELP_TEXT = (_('WIF keys are typed in Electrum, based on script type.') + '\n\n' + WIF_HELP_TEXT = (_('WIF keys are typed in Electrum, based on script type.') + '\n\n' +
_('A few examples') + ':\n' + _('A few examples') + ':\n' +
'p2pkh:KxZcY47uGp9a... \t-> 1DckmggQM...\n' + 'p2pkh:KxZcY47uGp9a... \t-> 1DckmggQM...\n' +

View File

@@ -1,5 +1,5 @@
from abc import abstractmethod from abc import abstractmethod
from typing import Dict, Any from typing import TYPE_CHECKING
from PyQt5.QtCore import Qt, QTimer, pyqtSignal, pyqtSlot, QSize from PyQt5.QtCore import Qt, QTimer, pyqtSignal, pyqtSlot, QSize
from PyQt5.QtGui import QPixmap from PyQt5.QtGui import QPixmap
@@ -10,6 +10,9 @@ from electrum.i18n import _
from ..util import Buttons, icon_path from ..util import Buttons, icon_path
from electrum.logging import get_logger from electrum.logging import get_logger
if TYPE_CHECKING:
from electrum.simple_config import SimpleConfig
class QEAbstractWizard(QDialog): class QEAbstractWizard(QDialog):
_logger = get_logger(__name__) _logger = get_logger(__name__)
@@ -88,7 +91,10 @@ class QEAbstractWizard(QDialog):
view = self.start_wizard() view = self.start_wizard()
self.load_next_component(view) self.load_next_component(view)
def load_next_component(self, view, wdata={}): def load_next_component(self, view, wdata=None):
if wdata is None:
wdata = {}
comp = self.view_to_component(view) comp = self.view_to_component(view)
try: try:
page = comp(self.main_widget, self) page = comp(self.main_widget, self)