11"""
22PyQt based UI for bitmessage, the main module
33"""
4- # pylint: disable=import-error,too-many-lines
4+ # pylint: disable=import-error,too-many-lines,no-member
55import hashlib
66import locale
77import os
@@ -410,6 +410,7 @@ def init_subscriptions_popup_menu(self, connectSignal=True):
410410 'customContextMenuRequested(const QPoint&)' ),
411411 self .on_context_menuSubscriptions )
412412
413+ # pylint: disable=unused-argument
413414 def init_sent_popup_menu (self , connectSignal = True ):
414415 # Actions
415416 self .actionTrashSentMessage = self .ui .sentContextMenuToolbar .addAction (
@@ -449,7 +450,6 @@ def rerenderTabTreeSubscriptions(self):
449450 if treeWidget .isSortingEnabled ():
450451 treeWidget .setSortingEnabled (False )
451452
452- widgets = {}
453453 i = 0
454454 while i < treeWidget .topLevelItemCount ():
455455 widget = treeWidget .topLevelItem (i )
@@ -538,8 +538,6 @@ def rerenderTabTree(self, tab):
538538 toAddress , 'enabled' )
539539 isChan = config .safeGetBoolean (
540540 toAddress , 'chan' )
541- isMaillinglist = config .safeGetBoolean (
542- toAddress , 'mailinglist' )
543541
544542 if treeWidget == self .ui .treeWidgetYourIdentities :
545543 if isChan :
@@ -577,7 +575,6 @@ def rerenderTabTree(self, tab):
577575 if treeWidget .isSortingEnabled ():
578576 treeWidget .setSortingEnabled (False )
579577
580- widgets = {}
581578 i = 0
582579 while i < treeWidget .topLevelItemCount ():
583580 widget = treeWidget .topLevelItem (i )
@@ -652,7 +649,7 @@ def __init__(self, parent=None):
652649 # Ask the user if we may delete their old version 1 addresses if they
653650 # have any.
654651 for addressInKeysFile in config .addresses ():
655- status , addressVersionNumber , streamNumber , hash = decodeAddress (
652+ status , addressVersionNumber , streamNumber , _ = decodeAddress (
656653 addressInKeysFile )
657654 if addressVersionNumber == 1 :
658655 displayMsg = _translate (
@@ -3787,7 +3784,7 @@ def on_action_SetAvatar(self, thisTableWidget):
37873784 def setAvatar (self , addressAtCurrentRow ):
37883785 if not os .path .exists (state .appdata + 'avatars/' ):
37893786 os .makedirs (state .appdata + 'avatars/' )
3790- hash = hashlib .md5 (addBMIfNotPresent (addressAtCurrentRow )).hexdigest ()
3787+ hash_ = hashlib .md5 (addBMIfNotPresent (addressAtCurrentRow )).hexdigest ()
37913788 extensions = [
37923789 'PNG' , 'GIF' , 'JPG' , 'JPEG' , 'SVG' , 'BMP' , 'MNG' , 'PBM' ,
37933790 'PGM' , 'PPM' , 'TIFF' , 'XBM' , 'XPM' , 'TGA' ]
@@ -3813,8 +3810,8 @@ def setAvatar(self, addressAtCurrentRow):
38133810 for ext in extensions :
38143811 filters += [names [ext ] + ' (*.' + ext .lower () + ')' ]
38153812 all_images_filter += ['*.' + ext .lower ()]
3816- upper = state .appdata + 'avatars/' + hash + '.' + ext .upper ()
3817- lower = state .appdata + 'avatars/' + hash + '.' + ext .lower ()
3813+ upper = state .appdata + 'avatars/' + hash_ + '.' + ext .upper ()
3814+ lower = state .appdata + 'avatars/' + hash_ + '.' + ext .lower ()
38183815 if os .path .isfile (lower ):
38193816 current_files += [lower ]
38203817 elif os .path .isfile (upper ):
@@ -3826,7 +3823,8 @@ def setAvatar(self, addressAtCurrentRow):
38263823 filter = ';;' .join (filters )
38273824 )
38283825 # determine the correct filename (note that avatars don't use the suffix)
3829- destination = state .appdata + 'avatars/' + hash + '.' + sourcefile .split ('.' )[- 1 ]
3826+ destination = state .appdata + 'avatars/' + hash_ \
3827+ + '.' + sourcefile .split ('.' )[- 1 ]
38303828 exists = QtCore .QFile .exists (destination )
38313829 if sourcefile == '' :
38323830 # ask for removal of avatar
0 commit comments