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,8 +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 (
656- addressInKeysFile )
652+ addressVersionNumber = decodeAddress (addressInKeysFile )[1 ]
657653 if addressVersionNumber == 1 :
658654 displayMsg = _translate (
659655 "MainWindow" ,
@@ -969,18 +965,6 @@ def appIndicatorSwitchQuietMode(self):
969965 str (not self .actionQuiet .isChecked ())
970966 )
971967
972- # application indicator show or hide
973- """# application indicator show or hide
974- def appIndicatorShowBitmessage(self):
975- #if self.actionShow == None:
976- # return
977- print self.actionShow.isChecked()
978- if not self.actionShow.isChecked():
979- self.hide()
980- #self.setWindowState(self.windowState() & QtCore.Qt.WindowMinimized)
981- else:
982- self.appIndicatorShowOrHideWindow()"""
983-
984968 # Show the program window and select inbox tab
985969 def appIndicatorInbox (self , item = None ):
986970 self .appIndicatorShow ()
@@ -3787,7 +3771,7 @@ def on_action_SetAvatar(self, thisTableWidget):
37873771 def setAvatar (self , addressAtCurrentRow ):
37883772 if not os .path .exists (state .appdata + 'avatars/' ):
37893773 os .makedirs (state .appdata + 'avatars/' )
3790- hash = hashlib .md5 (addBMIfNotPresent (addressAtCurrentRow )).hexdigest ()
3774+ hash_ = hashlib .md5 (addBMIfNotPresent (addressAtCurrentRow )).hexdigest ()
37913775 extensions = [
37923776 'PNG' , 'GIF' , 'JPG' , 'JPEG' , 'SVG' , 'BMP' , 'MNG' , 'PBM' ,
37933777 'PGM' , 'PPM' , 'TIFF' , 'XBM' , 'XPM' , 'TGA' ]
@@ -3813,8 +3797,8 @@ def setAvatar(self, addressAtCurrentRow):
38133797 for ext in extensions :
38143798 filters += [names [ext ] + ' (*.' + ext .lower () + ')' ]
38153799 all_images_filter += ['*.' + ext .lower ()]
3816- upper = state .appdata + 'avatars/' + hash + '.' + ext .upper ()
3817- lower = state .appdata + 'avatars/' + hash + '.' + ext .lower ()
3800+ upper = state .appdata + 'avatars/' + hash_ + '.' + ext .upper ()
3801+ lower = state .appdata + 'avatars/' + hash_ + '.' + ext .lower ()
38183802 if os .path .isfile (lower ):
38193803 current_files += [lower ]
38203804 elif os .path .isfile (upper ):
@@ -3826,7 +3810,8 @@ def setAvatar(self, addressAtCurrentRow):
38263810 filter = ';;' .join (filters )
38273811 )
38283812 # determine the correct filename (note that avatars don't use the suffix)
3829- destination = state .appdata + 'avatars/' + hash + '.' + sourcefile .split ('.' )[- 1 ]
3813+ destination = state .appdata + 'avatars/' + hash_ \
3814+ + '.' + sourcefile .split ('.' )[- 1 ]
38303815 exists = QtCore .QFile .exists (destination )
38313816 if sourcefile == '' :
38323817 # ask for removal of avatar
0 commit comments