@@ -1298,8 +1298,8 @@ def loadMessagelist(
12981298 tableWidget .setUpdatesEnabled (True )
12991299
13001300 # create application indicator
1301- def appIndicatorInit (self , app ):
1302- self .initTrayIcon ("can-icon-24px-red.png" , app )
1301+ def appIndicatorInit (self , _app ):
1302+ self .initTrayIcon ("can-icon-24px-red.png" , _app )
13031303 traySignal = "activated(QSystemTrayIcon::ActivationReason)"
13041304 QtCore .QObject .connect (self .tray , QtCore .SIGNAL (
13051305 traySignal ), self .__icon_activated )
@@ -1369,7 +1369,7 @@ def getUnread(self):
13691369 queryreturn = sqlQuery ('''
13701370 SELECT msgid, toaddress, read FROM inbox where folder='inbox'
13711371 ''' )
1372- for msgid , toAddress , read in queryreturn :
1372+ for _ , toAddress , read in queryreturn :
13731373
13741374 if not read :
13751375 # increment the unread subscriptions if True (1)
@@ -1820,10 +1820,12 @@ def setStatusIcon(self, color):
18201820 "MainWindow" , "Connected" ))
18211821 self .setTrayIconFile ("can-icon-24px-%s.png" % color )
18221822
1823- def initTrayIcon (self , iconFileName , app ):
1823+ def initTrayIcon (self , iconFileName , _app ):
18241824 self .currentTrayIconFileName = iconFileName
18251825 self .tray = QtGui .QSystemTrayIcon (
1826- self .calcTrayIcon (iconFileName , self .findInboxUnreadCount ()), app )
1826+ self .calcTrayIcon (iconFileName ,
1827+ self .findInboxUnreadCount ()),
1828+ _app )
18271829
18281830 def setTrayIconFile (self , iconFileName ):
18291831 self .currentTrayIconFileName = iconFileName
@@ -1925,10 +1927,7 @@ def updateSentItemStatusByAckdata(self, ackdata, textToDisplay):
19251927 if self .getCurrentFolder (treeWidget ) != "sent" :
19261928 continue
19271929 for i in range (sent .rowCount ()):
1928- toAddress = sent .item (i , 0 ).data (QtCore .Qt .UserRole )
19291930 tableAckdata = sent .item (i , 3 ).data ()
1930- status , addressVersionNumber , streamNumber , ripe = decodeAddress (
1931- toAddress )
19321931 if ackdata == tableAckdata :
19331932 sent .item (i , 3 ).setToolTip (textToDisplay )
19341933 try :
@@ -1977,7 +1976,7 @@ def displayAlert(self, title, text, exitAfterUserClicksOk):
19771976 self .updateStatusBar (text )
19781977 QtGui .QMessageBox .critical (self , title , text , QtGui .QMessageBox .Ok )
19791978 if exitAfterUserClicksOk :
1980- os ._exit (0 )
1979+ os ._exit (0 ) # pylint: disable=protected-access
19811980
19821981 def rerenderMessagelistFromLabels (self ):
19831982 for messagelist in (self .ui .tableWidgetInbox ,
@@ -1994,11 +1993,15 @@ def rerenderMessagelistToLabels(self):
19941993 messagelist .item (i , 0 ).setLabel ()
19951994
19961995 def rerenderAddressBook (self ):
1997- def addRow (address , label , type ):
1996+ def addRow (address , label , row_type ):
19981997 self .ui .tableWidgetAddressBook .insertRow (0 )
1999- newItem = Ui_AddressBookWidgetItemLabel (address , text_type (label , 'utf-8' ), type )
1998+ newItem = Ui_AddressBookWidgetItemLabel (address ,
1999+ text_type (label , 'utf-8' ),
2000+ row_type )
20002001 self .ui .tableWidgetAddressBook .setItem (0 , 0 , newItem )
2001- newItem = Ui_AddressBookWidgetItemAddress (address , text_type (label , 'utf-8' ), type )
2002+ newItem = Ui_AddressBookWidgetItemAddress (address ,
2003+ text_type (label , 'utf-8' ),
2004+ row_type )
20022005 self .ui .tableWidgetAddressBook .setItem (0 , 1 , newItem )
20032006
20042007 oldRows = {}
@@ -2093,7 +2096,7 @@ def click_pushButtonSend(self):
20932096 subject = str (self .ui .lineEditSubjectBroadcast .text ().toUtf8 ())
20942097 message = str (
20952098 self .ui .textEditMessageBroadcast .document ().toPlainText ().toUtf8 ())
2096- """
2099+ """ # pylint: disable=pointless-string-statement
20972100 The whole network message must fit in 2^18 bytes.
20982101 Let's assume 500 bytes of overhead. If someone wants to get that
20992102 too an exact number you are welcome to but I think that it would
@@ -2329,7 +2332,7 @@ def click_pushButtonSend(self):
23292332
23302333 def click_pushButtonLoadFromAddressBook (self ):
23312334 self .ui .tabWidget .setCurrentIndex (5 )
2332- for i in range (4 ):
2335+ for _ in range (4 ):
23332336 time .sleep (0.1 )
23342337 self .statusbar .clearMessage ()
23352338 time .sleep (0.1 )
@@ -2873,7 +2876,7 @@ def quit(self):
28732876 QtCore .QEventLoop .AllEvents , 1000
28742877 )
28752878 self .saveSettings ()
2876- for attr , obj in iteritems (self .ui .__dict__ ):
2879+ for _ , obj in iteritems (self .ui .__dict__ ):
28772880 if hasattr (obj , "__class__" ) \
28782881 and isinstance (obj , settingsmixin .SettingsMixin ):
28792882 saveMethod = getattr (obj , "saveSettings" , None )
@@ -3482,31 +3485,31 @@ def on_action_SubscriptionsDisable(self):
34823485
34833486 def on_context_menuSubscriptions (self , point ):
34843487 currentItem = self .getCurrentItem ()
3485- self . popMenuSubscriptions = QtGui .QMenu (self )
3488+ popMenuSubscriptions = QtGui .QMenu (self )
34863489 if isinstance (currentItem , Ui_AddressWidget ):
3487- self . popMenuSubscriptions .addAction (self .actionsubscriptionsNew )
3488- self . popMenuSubscriptions .addAction (self .actionsubscriptionsDelete )
3489- self . popMenuSubscriptions .addSeparator ()
3490+ popMenuSubscriptions .addAction (self .actionsubscriptionsNew )
3491+ popMenuSubscriptions .addAction (self .actionsubscriptionsDelete )
3492+ popMenuSubscriptions .addSeparator ()
34903493 if currentItem .isEnabled :
3491- self . popMenuSubscriptions .addAction (self .actionsubscriptionsDisable )
3494+ popMenuSubscriptions .addAction (self .actionsubscriptionsDisable )
34923495 else :
3493- self . popMenuSubscriptions .addAction (self .actionsubscriptionsEnable )
3494- self . popMenuSubscriptions .addAction (self .actionsubscriptionsSetAvatar )
3495- self . popMenuSubscriptions .addSeparator ()
3496- self . popMenuSubscriptions .addAction (self .actionsubscriptionsClipboard )
3497- self . popMenuSubscriptions .addAction (self .actionsubscriptionsSend )
3498- self . popMenuSubscriptions .addSeparator ()
3496+ popMenuSubscriptions .addAction (self .actionsubscriptionsEnable )
3497+ popMenuSubscriptions .addAction (self .actionsubscriptionsSetAvatar )
3498+ popMenuSubscriptions .addSeparator ()
3499+ popMenuSubscriptions .addAction (self .actionsubscriptionsClipboard )
3500+ popMenuSubscriptions .addAction (self .actionsubscriptionsSend )
3501+ popMenuSubscriptions .addSeparator ()
34993502
35003503 self ._contact_selected = currentItem
35013504 # preloaded gui.menu plugins with prefix 'address'
35023505 for plugin in self .menu_plugins ['address' ]:
3503- self . popMenuSubscriptions .addAction (plugin )
3504- self . popMenuSubscriptions .addSeparator ()
3506+ popMenuSubscriptions .addAction (plugin )
3507+ popMenuSubscriptions .addSeparator ()
35053508 if self .getCurrentFolder () != 'sent' :
3506- self . popMenuSubscriptions .addAction (self .actionMarkAllRead )
3507- if self . popMenuSubscriptions .isEmpty ():
3509+ popMenuSubscriptions .addAction (self .actionMarkAllRead )
3510+ if popMenuSubscriptions .isEmpty ():
35083511 return
3509- self . popMenuSubscriptions .exec_ (
3512+ popMenuSubscriptions .exec_ (
35103513 self .ui .treeWidgetSubscriptions .mapToGlobal (point ))
35113514
35123515 def widgetConvert (self , widget ):
@@ -3838,8 +3841,8 @@ def setAvatar(self, addressAtCurrentRow):
38383841 # copy the image file to the appdata folder
38393842 if (not exists ) | (overwrite == QtGui .QMessageBox .Yes ):
38403843 if overwrite == QtGui .QMessageBox .Yes :
3841- for file in current_files :
3842- QtCore .QFile .remove (file )
3844+ for _ in current_files :
3845+ QtCore .QFile .remove (_ )
38433846 QtCore .QFile .remove (destination )
38443847 # copy it
38453848 if sourcefile != '' :
@@ -3984,6 +3987,7 @@ def on_context_menuInbox(self, point):
39843987 self .popMenuInbox .addAction (self .actionReplyChan )
39853988 self .popMenuInbox .addAction (self .actionReply )
39863989 self .popMenuInbox .addAction (self .actionAddSenderToAddressBook )
3990+ # pylint: disable=no-member
39873991 self .actionClipboardMessagelist = self .ui .inboxContextMenuToolbar .addAction (
39883992 _translate ("MainWindow" , "Copy subject to clipboard" )
39893993 if tableWidget .currentColumn () == 2 else
@@ -4213,7 +4217,7 @@ def resetNamecoinConnection(self):
42134217
42144218 def initSettings (self ):
42154219 self .loadSettings ()
4216- for attr , obj in iteritems (self .ui .__dict__ ):
4220+ for _ , obj in iteritems (self .ui .__dict__ ):
42174221 if hasattr (obj , "__class__" ) and \
42184222 isinstance (obj , settingsmixin .SettingsMixin ):
42194223 loadMethod = getattr (obj , "loadSettings" , None )
0 commit comments