Skip to content

Commit 0e23e3c

Browse files
committed
Resolved pylint warnings in address_dialogs
1 parent 5a6f9d5 commit 0e23e3c

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/bitmessageqt/__init__.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2475,7 +2475,7 @@ def click_pushButtonAddAddressBook(self, dialog=None):
24752475
dialog.exec_()
24762476
try:
24772477
address, label = dialog.data
2478-
except AttributeError:
2478+
except (AttributeError, TypeError):
24792479
return
24802480

24812481
# First we must check to see if the address is already in the
@@ -2520,7 +2520,7 @@ def click_pushButtonAddSubscription(self):
25202520
dialog.exec_()
25212521
try:
25222522
address, label = dialog.data
2523-
except AttributeError:
2523+
except (AttributeError, TypeError):
25242524
return
25252525

25262526
# We must check to see if the address is already in the
@@ -2785,9 +2785,8 @@ def on_action_EmailGatewayDialog(self):
27852785
dialog = dialogs.EmailGatewayDialog(self, config=BMConfigParser())
27862786
# For Modal dialogs
27872787
dialog.exec_()
2788-
try:
2789-
acct = dialog.data
2790-
except AttributeError:
2788+
acct = dialog.data
2789+
if not acct:
27912790
return
27922791

27932792
# Only settings remain here

src/bitmessageqt/address_dialogs.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class AddressDataDialog(QtWidgets.QDialog, AddressCheckMixin):
9494
def __init__(self, parent):
9595
super(AddressDataDialog, self).__init__(parent)
9696
self.parent = parent
97-
self.data = ("", "")
97+
self.data = None
9898

9999
def accept(self):
100100
"""Callback for QDialog accepting value"""
@@ -190,6 +190,7 @@ class NewSubscriptionDialog(AddressDataDialog, RetranslateMixin):
190190
def __init__(self, parent=None):
191191
super(NewSubscriptionDialog, self).__init__(parent)
192192
widgets.load('newsubscriptiondialog.ui', self)
193+
self.recent = []
193194
self._setup()
194195

195196
def _onSuccess(self, addressVersion, streamNumber, ripe):
@@ -313,6 +314,7 @@ def __init__(self, parent, config=None, account=None):
313314
widgets.load('emailgateway.ui', self)
314315
self.parent = parent
315316
self.config = config
317+
self.data = None
316318
if account:
317319
self.acct = account
318320
self.setWindowTitle(_translate(

0 commit comments

Comments
 (0)