fixed CQ for bitmessageqt.migrationwizard module

This commit is contained in:
coolguy-cell 2020-06-05 18:32:19 +05:30
parent b750b02963
commit e3372c6179
No known key found for this signature in database
GPG Key ID: CD3A42E1D470AD70

View File

@ -1,24 +1,35 @@
#!/usr/bin/env python2.7 #!/usr/bin/env python2.7
from PyQt4 import QtCore, QtGui """
src/bitmessageqt/migrationwizard.py
===============================
"""
# pylint: disable=too-few-public-methods,no-self-use,unused-argument
from PyQt4 import QtGui
class MigrationWizardIntroPage(QtGui.QWizardPage): class MigrationWizardIntroPage(QtGui.QWizardPage):
"""MigrationWizardIntroPage class for Qt UI"""
def __init__(self): def __init__(self):
super(QtGui.QWizardPage, self).__init__() super(QtGui.QWizardPage, self).__init__()
self.setTitle("Migrating configuration") self.setTitle("Migrating configuration")
label = QtGui.QLabel("This wizard will help you to migrate your configuration. " label = QtGui.QLabel("This wizard will help you to migrate your configuration. "
"You can still keep using PyBitMessage once you migrate, the changes are backwards compatible.") "You can still keep using PyBitMessage once you migrate, "
"the changes are backwards compatible.")
label.setWordWrap(True) label.setWordWrap(True)
layout = QtGui.QVBoxLayout() layout = QtGui.QVBoxLayout()
layout.addWidget(label) layout.addWidget(label)
self.setLayout(layout) self.setLayout(layout)
def nextId(self): def nextId(self):
"""It returns next id"""
return 1 return 1
class MigrationWizardAddressesPage(QtGui.QWizardPage): class MigrationWizardAddressesPage(QtGui.QWizardPage):
"""MigrationWizardAddressesPage class for Qt Ui"""
def __init__(self, addresses): def __init__(self, addresses):
super(QtGui.QWizardPage, self).__init__() super(QtGui.QWizardPage, self).__init__()
self.setTitle("Addresses") self.setTitle("Addresses")
@ -29,12 +40,14 @@ class MigrationWizardAddressesPage(QtGui.QWizardPage):
layout = QtGui.QVBoxLayout() layout = QtGui.QVBoxLayout()
layout.addWidget(label) layout.addWidget(label)
self.setLayout(layout) self.setLayout(layout)
def nextId(self): def nextId(self):
"""It returns next id"""
return 10 return 10
class MigrationWizardGPUPage(QtGui.QWizardPage): class MigrationWizardGPUPage(QtGui.QWizardPage):
"""MigrationWizardGPUPage class for Qt Ui"""
def __init__(self): def __init__(self):
super(QtGui.QWizardPage, self).__init__() super(QtGui.QWizardPage, self).__init__()
self.setTitle("GPU") self.setTitle("GPU")
@ -45,12 +58,14 @@ class MigrationWizardGPUPage(QtGui.QWizardPage):
layout = QtGui.QVBoxLayout() layout = QtGui.QVBoxLayout()
layout.addWidget(label) layout.addWidget(label)
self.setLayout(layout) self.setLayout(layout)
def nextId(self): def nextId(self):
"""It returns next id"""
return 10 return 10
class MigrationWizardConclusionPage(QtGui.QWizardPage): class MigrationWizardConclusionPage(QtGui.QWizardPage):
"""MigrationWizardConclusionPage class for Qt Ui"""
def __init__(self): def __init__(self):
super(QtGui.QWizardPage, self).__init__() super(QtGui.QWizardPage, self).__init__()
self.setTitle("All done!") self.setTitle("All done!")
@ -64,11 +79,12 @@ class MigrationWizardConclusionPage(QtGui.QWizardPage):
class Ui_MigrationWizard(QtGui.QWizard): class Ui_MigrationWizard(QtGui.QWizard):
"""Ui_MigrationWizard class for Qt Ui"""
def __init__(self, addresses): def __init__(self, addresses):
super(QtGui.QWizard, self).__init__() super(QtGui.QWizard, self).__init__()
self.pages = {} self.pages = {}
page = MigrationWizardIntroPage() page = MigrationWizardIntroPage()
self.setPage(0, page) self.setPage(0, page)
self.setStartId(0) self.setStartId(0)
@ -81,4 +97,4 @@ class Ui_MigrationWizard(QtGui.QWizard):
self.setWindowTitle("Migration from PyBitMessage wizard") self.setWindowTitle("Migration from PyBitMessage wizard")
self.adjustSize() self.adjustSize()
self.show() self.show()