Fixed flake8 messages for bitmessageqt/bitmessageui.py.

Fixed some spaces around operators. Fixed line length errors. Removed
unused comment (since 2016) and unused import (since 2012).
This commit is contained in:
Jeroen van Bennekum 2022-08-22 17:16:05 +02:00 committed by Peter Šurda
parent e983c23fa6
commit ea2fdf0dcf
Signed by: PeterSurda
GPG Key ID: 3E47497CF67ABB95

View File

@ -24,24 +24,28 @@ except AttributeError:
try: try:
_encoding = QtGui.QApplication.UnicodeUTF8 _encoding = QtGui.QApplication.UnicodeUTF8
def _translate(context, text, disambig, encoding = QtCore.QCoreApplication.CodecForTr, n = None):
def _translate(context, text, disambig, encoding=QtCore.QCoreApplication.CodecForTr, n=None):
if n is None: if n is None:
return QtGui.QApplication.translate(context, text, disambig, _encoding) return QtGui.QApplication.translate(context, text, disambig, _encoding)
else: else:
return QtGui.QApplication.translate(context, text, disambig, _encoding, n) return QtGui.QApplication.translate(context, text, disambig, _encoding, n)
except AttributeError: except AttributeError:
def _translate(context, text, disambig, encoding = QtCore.QCoreApplication.CodecForTr, n = None): def _translate(context, text, disambig, encoding=QtCore.QCoreApplication.CodecForTr, n=None):
if n is None: if n is None:
return QtGui.QApplication.translate(context, text, disambig) return QtGui.QApplication.translate(context, text, disambig)
else: else:
return QtGui.QApplication.translate(context, text, disambig, QtCore.QCoreApplication.CodecForTr, n) return QtGui.QApplication.translate(context, text, disambig, QtCore.QCoreApplication.CodecForTr, n)
class Ui_MainWindow(object): class Ui_MainWindow(object):
def setupUi(self, MainWindow): def setupUi(self, MainWindow):
MainWindow.setObjectName(_fromUtf8("MainWindow")) MainWindow.setObjectName(_fromUtf8("MainWindow"))
MainWindow.resize(885, 580) MainWindow.resize(885, 580)
icon = QtGui.QIcon() icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/can-icon-24px.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) icon.addPixmap(
QtGui.QPixmap(_fromUtf8(":/newPrefix/images/can-icon-24px.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off
)
MainWindow.setWindowIcon(icon) MainWindow.setWindowIcon(icon)
MainWindow.setTabShape(QtGui.QTabWidget.Rounded) MainWindow.setTabShape(QtGui.QTabWidget.Rounded)
self.centralwidget = QtGui.QWidget(MainWindow) self.centralwidget = QtGui.QWidget(MainWindow)
@ -75,7 +79,9 @@ class Ui_MainWindow(object):
self.treeWidgetYourIdentities.setObjectName(_fromUtf8("treeWidgetYourIdentities")) self.treeWidgetYourIdentities.setObjectName(_fromUtf8("treeWidgetYourIdentities"))
self.treeWidgetYourIdentities.resize(200, self.treeWidgetYourIdentities.height()) self.treeWidgetYourIdentities.resize(200, self.treeWidgetYourIdentities.height())
icon1 = QtGui.QIcon() icon1 = QtGui.QIcon()
icon1.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/identities.png")), QtGui.QIcon.Selected, QtGui.QIcon.Off) icon1.addPixmap(
QtGui.QPixmap(_fromUtf8(":/newPrefix/images/identities.png")), QtGui.QIcon.Selected, QtGui.QIcon.Off
)
self.treeWidgetYourIdentities.headerItem().setIcon(0, icon1) self.treeWidgetYourIdentities.headerItem().setIcon(0, icon1)
self.verticalSplitter_12.addWidget(self.treeWidgetYourIdentities) self.verticalSplitter_12.addWidget(self.treeWidgetYourIdentities)
self.pushButtonNewAddress = QtGui.QPushButton(self.inbox) self.pushButtonNewAddress = QtGui.QPushButton(self.inbox)
@ -176,7 +182,9 @@ class Ui_MainWindow(object):
self.tableWidgetAddressBook.resize(200, self.tableWidgetAddressBook.height()) self.tableWidgetAddressBook.resize(200, self.tableWidgetAddressBook.height())
item = QtGui.QTableWidgetItem() item = QtGui.QTableWidgetItem()
icon3 = QtGui.QIcon() icon3 = QtGui.QIcon()
icon3.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/addressbook.png")), QtGui.QIcon.Selected, QtGui.QIcon.Off) icon3.addPixmap(
QtGui.QPixmap(_fromUtf8(":/newPrefix/images/addressbook.png")), QtGui.QIcon.Selected, QtGui.QIcon.Off
)
item.setIcon(icon3) item.setIcon(icon3)
self.tableWidgetAddressBook.setHorizontalHeaderItem(0, item) self.tableWidgetAddressBook.setHorizontalHeaderItem(0, item)
item = QtGui.QTableWidgetItem() item = QtGui.QTableWidgetItem()
@ -377,7 +385,9 @@ class Ui_MainWindow(object):
self.treeWidgetSubscriptions.setObjectName(_fromUtf8("treeWidgetSubscriptions")) self.treeWidgetSubscriptions.setObjectName(_fromUtf8("treeWidgetSubscriptions"))
self.treeWidgetSubscriptions.resize(200, self.treeWidgetSubscriptions.height()) self.treeWidgetSubscriptions.resize(200, self.treeWidgetSubscriptions.height())
icon5 = QtGui.QIcon() icon5 = QtGui.QIcon()
icon5.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/subscriptions.png")), QtGui.QIcon.Selected, QtGui.QIcon.Off) icon5.addPixmap(
QtGui.QPixmap(_fromUtf8(":/newPrefix/images/subscriptions.png")), QtGui.QIcon.Selected, QtGui.QIcon.Off
)
self.treeWidgetSubscriptions.headerItem().setIcon(0, icon5) self.treeWidgetSubscriptions.headerItem().setIcon(0, icon5)
self.verticalSplitter_3.addWidget(self.treeWidgetSubscriptions) self.verticalSplitter_3.addWidget(self.treeWidgetSubscriptions)
self.pushButtonAddSubscription = QtGui.QPushButton(self.subscriptions) self.pushButtonAddSubscription = QtGui.QPushButton(self.subscriptions)
@ -456,7 +466,9 @@ class Ui_MainWindow(object):
self.horizontalSplitter_4.setCollapsible(1, False) self.horizontalSplitter_4.setCollapsible(1, False)
self.gridLayout_3.addWidget(self.horizontalSplitter_4, 0, 0, 1, 1) self.gridLayout_3.addWidget(self.horizontalSplitter_4, 0, 0, 1, 1)
icon6 = QtGui.QIcon() icon6 = QtGui.QIcon()
icon6.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/subscriptions.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) icon6.addPixmap(
QtGui.QPixmap(_fromUtf8(":/newPrefix/images/subscriptions.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off
)
self.tabWidget.addTab(self.subscriptions, icon6, _fromUtf8("")) self.tabWidget.addTab(self.subscriptions, icon6, _fromUtf8(""))
self.chans = QtGui.QWidget() self.chans = QtGui.QWidget()
self.chans.setObjectName(_fromUtf8("chans")) self.chans.setObjectName(_fromUtf8("chans"))
@ -476,7 +488,9 @@ class Ui_MainWindow(object):
self.treeWidgetChans.setObjectName(_fromUtf8("treeWidgetChans")) self.treeWidgetChans.setObjectName(_fromUtf8("treeWidgetChans"))
self.treeWidgetChans.resize(200, self.treeWidgetChans.height()) self.treeWidgetChans.resize(200, self.treeWidgetChans.height())
icon7 = QtGui.QIcon() icon7 = QtGui.QIcon()
icon7.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/can-icon-16px.png")), QtGui.QIcon.Selected, QtGui.QIcon.Off) icon7.addPixmap(
QtGui.QPixmap(_fromUtf8(":/newPrefix/images/can-icon-16px.png")), QtGui.QIcon.Selected, QtGui.QIcon.Off
)
self.treeWidgetChans.headerItem().setIcon(0, icon7) self.treeWidgetChans.headerItem().setIcon(0, icon7)
self.verticalSplitter_17.addWidget(self.treeWidgetChans) self.verticalSplitter_17.addWidget(self.treeWidgetChans)
self.pushButtonAddChan = QtGui.QPushButton(self.chans) self.pushButtonAddChan = QtGui.QPushButton(self.chans)
@ -556,7 +570,9 @@ class Ui_MainWindow(object):
self.horizontalSplitter_7.setCollapsible(1, False) self.horizontalSplitter_7.setCollapsible(1, False)
self.gridLayout_4.addWidget(self.horizontalSplitter_7, 0, 0, 1, 1) self.gridLayout_4.addWidget(self.horizontalSplitter_7, 0, 0, 1, 1)
icon8 = QtGui.QIcon() icon8 = QtGui.QIcon()
icon8.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/can-icon-16px.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) icon8.addPixmap(
QtGui.QPixmap(_fromUtf8(":/newPrefix/images/can-icon-16px.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off
)
self.tabWidget.addTab(self.chans, icon8, _fromUtf8("")) self.tabWidget.addTab(self.chans, icon8, _fromUtf8(""))
self.blackwhitelist = Blacklist() self.blackwhitelist = Blacklist()
self.tabWidget.addTab(self.blackwhitelist, QtGui.QIcon(":/newPrefix/images/blacklist.png"), "") self.tabWidget.addTab(self.blackwhitelist, QtGui.QIcon(":/newPrefix/images/blacklist.png"), "")
@ -701,19 +717,24 @@ class Ui_MainWindow(object):
self.label_3.setText(_translate("MainWindow", "Subject:", None)) self.label_3.setText(_translate("MainWindow", "Subject:", None))
self.label_2.setText(_translate("MainWindow", "From:", None)) self.label_2.setText(_translate("MainWindow", "From:", None))
self.label.setText(_translate("MainWindow", "To:", None)) self.label.setText(_translate("MainWindow", "To:", None))
#self.textEditMessage.setHtml("") self.tabWidgetSend.setTabText(
self.tabWidgetSend.setTabText(self.tabWidgetSend.indexOf(self.sendDirect), _translate("MainWindow", "Send ordinary Message", None)) self.tabWidgetSend.indexOf(self.sendDirect), _translate("MainWindow", "Send ordinary Message", None)
)
self.label_8.setText(_translate("MainWindow", "From:", None)) self.label_8.setText(_translate("MainWindow", "From:", None))
self.label_7.setText(_translate("MainWindow", "Subject:", None)) self.label_7.setText(_translate("MainWindow", "Subject:", None))
#self.textEditMessageBroadcast.setHtml("") self.tabWidgetSend.setTabText(
self.tabWidgetSend.setTabText(self.tabWidgetSend.indexOf(self.sendBroadcast), _translate("MainWindow", "Send Message to your Subscribers", None)) self.tabWidgetSend.indexOf(self.sendBroadcast),
_translate("MainWindow", "Send Message to your Subscribers", None)
)
self.pushButtonTTL.setText(_translate("MainWindow", "TTL:", None)) self.pushButtonTTL.setText(_translate("MainWindow", "TTL:", None))
hours = 48 hours = 48
try: try:
hours = int(config.getint('bitmessagesettings', 'ttl')/60/60) hours = int(config.getint('bitmessagesettings', 'ttl') / 60 / 60)
except: except:
pass pass
self.labelHumanFriendlyTTLDescription.setText(_translate("MainWindow", "%n hour(s)", None, QtCore.QCoreApplication.CodecForTr, hours)) self.labelHumanFriendlyTTLDescription.setText(
_translate("MainWindow", "%n hour(s)", None, QtCore.QCoreApplication.CodecForTr, hours)
)
self.pushButtonClear.setText(_translate("MainWindow", "Clear", None)) self.pushButtonClear.setText(_translate("MainWindow", "Clear", None))
self.pushButtonSend.setText(_translate("MainWindow", "Send", None)) self.pushButtonSend.setText(_translate("MainWindow", "Send", None))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.send), _translate("MainWindow", "Send", None)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.send), _translate("MainWindow", "Send", None))
@ -733,7 +754,10 @@ class Ui_MainWindow(object):
item.setText(_translate("MainWindow", "Subject", None)) item.setText(_translate("MainWindow", "Subject", None))
item = self.tableWidgetInboxSubscriptions.horizontalHeaderItem(3) item = self.tableWidgetInboxSubscriptions.horizontalHeaderItem(3)
item.setText(_translate("MainWindow", "Received", None)) item.setText(_translate("MainWindow", "Received", None))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.subscriptions), _translate("MainWindow", "Subscriptions", None)) self.tabWidget.setTabText(
self.tabWidget.indexOf(self.subscriptions),
_translate("MainWindow", "Subscriptions", None)
)
self.treeWidgetChans.headerItem().setText(0, _translate("MainWindow", "Chans", None)) self.treeWidgetChans.headerItem().setText(0, _translate("MainWindow", "Chans", None))
self.pushButtonAddChan.setText(_translate("MainWindow", "Add Chan", None)) self.pushButtonAddChan.setText(_translate("MainWindow", "Add Chan", None))
self.inboxSearchLineEditChans.setPlaceholderText(_translate("MainWindow", "Search", None)) self.inboxSearchLineEditChans.setPlaceholderText(_translate("MainWindow", "Search", None))
@ -753,9 +777,15 @@ class Ui_MainWindow(object):
item.setText(_translate("MainWindow", "Received", None)) item.setText(_translate("MainWindow", "Received", None))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.chans), _translate("MainWindow", "Chans", None)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.chans), _translate("MainWindow", "Chans", None))
self.blackwhitelist.retranslateUi() self.blackwhitelist.retranslateUi()
self.tabWidget.setTabText(self.tabWidget.indexOf(self.blackwhitelist), _translate("blacklist", "Blacklist", None)) self.tabWidget.setTabText(
self.tabWidget.indexOf(self.blackwhitelist),
_translate("blacklist", "Blacklist", None)
)
self.networkstatus.retranslateUi() self.networkstatus.retranslateUi()
self.tabWidget.setTabText(self.tabWidget.indexOf(self.networkstatus), _translate("networkstatus", "Network Status", None)) self.tabWidget.setTabText(
self.tabWidget.indexOf(self.networkstatus),
_translate("networkstatus", "Network Status", None)
)
self.menuFile.setTitle(_translate("MainWindow", "File", None)) self.menuFile.setTitle(_translate("MainWindow", "File", None))
self.menuSettings.setTitle(_translate("MainWindow", "Settings", None)) self.menuSettings.setTitle(_translate("MainWindow", "Settings", None))
self.menuHelp.setTitle(_translate("MainWindow", "Help", None)) self.menuHelp.setTitle(_translate("MainWindow", "Help", None))
@ -768,21 +798,20 @@ class Ui_MainWindow(object):
self.actionSupport.setText(_translate("MainWindow", "Contact support", None)) self.actionSupport.setText(_translate("MainWindow", "Contact support", None))
self.actionAbout.setText(_translate("MainWindow", "About", None)) self.actionAbout.setText(_translate("MainWindow", "About", None))
self.actionSettings.setText(_translate("MainWindow", "Settings", None)) self.actionSettings.setText(_translate("MainWindow", "Settings", None))
self.actionRegenerateDeterministicAddresses.setText(_translate("MainWindow", "Regenerate deterministic addresses", None)) self.actionRegenerateDeterministicAddresses.setText(
_translate("MainWindow", "Regenerate deterministic addresses", None)
)
self.actionDeleteAllTrashedMessages.setText(_translate("MainWindow", "Delete all trashed messages", None)) self.actionDeleteAllTrashedMessages.setText(_translate("MainWindow", "Delete all trashed messages", None))
self.actionJoinChan.setText(_translate("MainWindow", "Join / Create chan", None)) self.actionJoinChan.setText(_translate("MainWindow", "Join / Create chan", None))
self.updateNetworkSwitchMenuLabel() self.updateNetworkSwitchMenuLabel()
import bitmessage_icons_rc
if __name__ == "__main__": if __name__ == "__main__":
import sys import sys
app = QtGui.QApplication(sys.argv) app = QtGui.QApplication(sys.argv)
MainWindow = settingsmixin.SMainWindow() MainWindow = settingsmixin.SMainWindow()
ui = Ui_MainWindow() ui = Ui_MainWindow()
ui.setupUi(MainWindow) ui.setupUi(MainWindow)
MainWindow.show() MainWindow.show()
sys.exit(app.exec_()) sys.exit(app.exec_())