Skip to content

Commit 0f06903

Browse files
committed
Resolved some pylint warnings in bitmessageqt
1 parent 468eb26 commit 0f06903

File tree

1 file changed

+27
-23
lines changed

1 file changed

+27
-23
lines changed

src/bitmessageqt/__init__.py

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1517,7 +1517,13 @@ def click_actionManageKeys(self):
15171517

15181518
# menu button 'delete all treshed messages'
15191519
def click_actionDeleteAllTrashedMessages(self):
1520-
if QtWidgets.QMessageBox.question(self, _translate("MainWindow", "Delete trash?"), _translate("MainWindow", "Are you sure you want to delete all trashed messages?"), QtWidgets.QMessageBox.Yes, QtWidgets.QMessageBox.No) == QtWidgets.QMessageBox.No:
1520+
if QtWidgets.QMessageBox.question(
1521+
self, _translate("MainWindow", "Delete trash?"),
1522+
_translate(
1523+
"MainWindow",
1524+
"Are you sure you want to delete all trashed messages?"
1525+
), QtWidgets.QMessageBox.Yes, QtWidgets.QMessageBox.No
1526+
) == QtWidgets.QMessageBox.No:
15211527
return
15221528
sqlStoredProcedure('deleteandvacuume')
15231529
self.rerenderTabTreeMessages()
@@ -2008,15 +2014,15 @@ def click_pushButtonSend(self):
20082014
toAddress = acct.toAddress
20092015
else:
20102016
if QtWidgets.QMessageBox.question(
2011-
self, "Sending an email?",
2012-
_translate(
2013-
"MainWindow",
2014-
"You are trying to send an email"
2015-
" instead of a bitmessage. This"
2016-
" requires registering with a"
2017-
" gateway. Attempt to register?"
2018-
), QtWidgets.QMessageBox.Yes
2019-
| QtWidgets.QMessageBox.No
2017+
self, "Sending an email?",
2018+
_translate(
2019+
"MainWindow",
2020+
"You are trying to send an email"
2021+
" instead of a bitmessage. This"
2022+
" requires registering with a"
2023+
" gateway. Attempt to register?"
2024+
), QtWidgets.QMessageBox.Yes |
2025+
QtWidgets.QMessageBox.No
20202026
) != QtWidgets.QMessageBox.Yes:
20212027
continue
20222028
email = acct.getLabel()
@@ -2434,9 +2440,9 @@ def displayNewInboxMessage(
24342440
sound.SOUND_UNKNOWN
24352441
)
24362442
if self.getCurrentAccount() is not None and (
2437-
(self.getCurrentFolder(treeWidget) != "inbox"
2438-
and self.getCurrentFolder(treeWidget) is not None)
2439-
or self.getCurrentAccount(treeWidget) != acct.address):
2443+
(self.getCurrentFolder(treeWidget) != "inbox" and
2444+
self.getCurrentFolder(treeWidget) is not None) or
2445+
self.getCurrentAccount(treeWidget) != acct.address):
24402446
# Ubuntu should notify of new message irespective of
24412447
# whether it's in current message list or not
24422448
self.indicatorUpdate(True, to_label=acct.toLabel)
@@ -3436,10 +3442,9 @@ def on_action_InboxSaveMessageAs(self):
34363442

34373443
defaultFilename = "".join(
34383444
x for x in subjectAtCurrentInboxRow if x.isalnum()) + '.txt'
3439-
filename, filetype = QtWidgets.QFileDialog.getSaveFileName(
3445+
filename = QtWidgets.QFileDialog.getSaveFileName(
34403446
self, _translate("MainWindow", "Save As..."), defaultFilename,
3441-
"Text files (*.txt);;All files (*.*)"
3442-
)
3447+
"Text files (*.txt);;All files (*.*)")[0]
34433448
if not filename:
34443449
return
34453450
try:
@@ -3922,8 +3927,8 @@ def on_action_ClipboardMessagelist(self):
39223927
account = accountClass(myAddress)
39233928
if isinstance(account, GatewayAccount) \
39243929
and otherAddress == account.relayAddress and (
3925-
(currentColumn in (0, 2) and currentFolder == "sent")
3926-
or (currentColumn in (1, 2) and currentFolder != "sent")):
3930+
(currentColumn in (0, 2) and currentFolder == "sent") or
3931+
(currentColumn in (1, 2) and currentFolder != "sent")):
39273932
text = tableWidget.item(currentRow, currentColumn).label
39283933
else:
39293934
text = tableWidget.item(currentRow, currentColumn).data(QtCore.Qt.UserRole)
@@ -3983,10 +3988,9 @@ def setAvatar(self, addressAtCurrentRow):
39833988
current_files += [upper]
39843989
filters[0:0] = ['Image files (' + ' '.join(all_images_filter) + ')']
39853990
filters[1:1] = ['All files (*.*)']
3986-
sourcefile, filetype = QtWidgets.QFileDialog.getOpenFileName(
3991+
sourcefile = QtWidgets.QFileDialog.getOpenFileName(
39873992
self, _translate("MainWindow", "Set avatar..."),
3988-
filter=';;'.join(filters)
3989-
)
3993+
filter=';;'.join(filters))[0]
39903994
# determine the correct filename (note that avatars don't use the suffix)
39913995
destination = state.appdata + 'avatars/' + hash + '.' + sourcefile.split('.')[-1]
39923996
exists = QtCore.QFile.exists(destination)
@@ -4051,10 +4055,10 @@ def setAddressSound(self, addr):
40514055
"MainWindow", "Sound files (%s)" %
40524056
' '.join(['*%s%s' % (os.extsep, ext) for ext in sound.extensions])
40534057
))]
4054-
sourcefile, filetype = QtWidgets.QFileDialog.getOpenFileName(
4058+
sourcefile = QtWidgets.QFileDialog.getOpenFileName(
40554059
self, _translate("MainWindow", "Set notification sound..."),
40564060
filter=';;'.join(filters)
4057-
)
4061+
)[0]
40584062

40594063
if not sourcefile:
40604064
return

0 commit comments

Comments
 (0)