Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 8 additions & 23 deletions src/bitmessageqt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
PyQt based UI for bitmessage, the main module
"""
# pylint: disable=import-error,too-many-lines
# pylint: disable=import-error,too-many-lines,no-member
import hashlib
import locale
import os
Expand Down Expand Up @@ -410,6 +410,7 @@ def init_subscriptions_popup_menu(self, connectSignal=True):
'customContextMenuRequested(const QPoint&)'),
self.on_context_menuSubscriptions)

# pylint: disable=unused-argument
def init_sent_popup_menu(self, connectSignal=True):
# Actions
self.actionTrashSentMessage = self.ui.sentContextMenuToolbar.addAction(
Expand Down Expand Up @@ -449,7 +450,6 @@ def rerenderTabTreeSubscriptions(self):
if treeWidget.isSortingEnabled():
treeWidget.setSortingEnabled(False)

widgets = {}
i = 0
while i < treeWidget.topLevelItemCount():
widget = treeWidget.topLevelItem(i)
Expand Down Expand Up @@ -538,8 +538,6 @@ def rerenderTabTree(self, tab):
toAddress, 'enabled')
isChan = config.safeGetBoolean(
toAddress, 'chan')
isMaillinglist = config.safeGetBoolean(
toAddress, 'mailinglist')

if treeWidget == self.ui.treeWidgetYourIdentities:
if isChan:
Expand Down Expand Up @@ -577,7 +575,6 @@ def rerenderTabTree(self, tab):
if treeWidget.isSortingEnabled():
treeWidget.setSortingEnabled(False)

widgets = {}
i = 0
while i < treeWidget.topLevelItemCount():
widget = treeWidget.topLevelItem(i)
Expand Down Expand Up @@ -652,8 +649,7 @@ def __init__(self, parent=None):
# Ask the user if we may delete their old version 1 addresses if they
# have any.
for addressInKeysFile in config.addresses():
status, addressVersionNumber, streamNumber, hash = decodeAddress(
addressInKeysFile)
addressVersionNumber = decodeAddress(addressInKeysFile)[1]
if addressVersionNumber == 1:
displayMsg = _translate(
"MainWindow",
Expand Down Expand Up @@ -969,18 +965,6 @@ def appIndicatorSwitchQuietMode(self):
str(not self.actionQuiet.isChecked())
)

# application indicator show or hide
"""# application indicator show or hide
def appIndicatorShowBitmessage(self):
#if self.actionShow == None:
# return
print self.actionShow.isChecked()
if not self.actionShow.isChecked():
self.hide()
#self.setWindowState(self.windowState() & QtCore.Qt.WindowMinimized)
else:
self.appIndicatorShowOrHideWindow()"""

# Show the program window and select inbox tab
def appIndicatorInbox(self, item=None):
self.appIndicatorShow()
Expand Down Expand Up @@ -3787,7 +3771,7 @@ def on_action_SetAvatar(self, thisTableWidget):
def setAvatar(self, addressAtCurrentRow):
if not os.path.exists(state.appdata + 'avatars/'):
os.makedirs(state.appdata + 'avatars/')
hash = hashlib.md5(addBMIfNotPresent(addressAtCurrentRow)).hexdigest()
hash_ = hashlib.md5(addBMIfNotPresent(addressAtCurrentRow)).hexdigest()
extensions = [
'PNG', 'GIF', 'JPG', 'JPEG', 'SVG', 'BMP', 'MNG', 'PBM',
'PGM', 'PPM', 'TIFF', 'XBM', 'XPM', 'TGA']
Expand All @@ -3813,8 +3797,8 @@ def setAvatar(self, addressAtCurrentRow):
for ext in extensions:
filters += [names[ext] + ' (*.' + ext.lower() + ')']
all_images_filter += ['*.' + ext.lower()]
upper = state.appdata + 'avatars/' + hash + '.' + ext.upper()
lower = state.appdata + 'avatars/' + hash + '.' + ext.lower()
upper = state.appdata + 'avatars/' + hash_ + '.' + ext.upper()
lower = state.appdata + 'avatars/' + hash_ + '.' + ext.lower()
if os.path.isfile(lower):
current_files += [lower]
elif os.path.isfile(upper):
Expand All @@ -3826,7 +3810,8 @@ def setAvatar(self, addressAtCurrentRow):
filter=';;'.join(filters)
)
# determine the correct filename (note that avatars don't use the suffix)
destination = state.appdata + 'avatars/' + hash + '.' + sourcefile.split('.')[-1]
destination = state.appdata + 'avatars/' + hash_ \
+ '.' + sourcefile.split('.')[-1]
exists = QtCore.QFile.exists(destination)
if sourcefile == '':
# ask for removal of avatar
Expand Down
3 changes: 2 additions & 1 deletion src/bitmessageqt/bitmessageui.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
#
# WARNING! All changes made in this file will be lost!

from PyQt4 import QtCore, QtGui
# pylint: disable=attribute-defined-outside-init
from PyQt4 import QtCore, QtGui # pylint: disable=import-error
from bmconfigparser import config
from foldertree import AddressBookCompleter
from messageview import MessageView
Expand Down
2 changes: 1 addition & 1 deletion src/bitmessageqt/messagecompose.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Message editor with a wheel zoom functionality
"""

from PyQt4 import QtCore, QtGui # pylint disable:import-error
from PyQt4 import QtCore, QtGui # pylint disable=import-error


class MessageCompose(QtGui.QTextEdit):
Expand Down
2 changes: 1 addition & 1 deletion src/bitmessageqt/messageview.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

"""

from PyQt4 import QtCore, QtGui
from PyQt4 import QtCore, QtGui # pylint: disable=import-error

from safehtmlparser import SafeHTMLParser
from tr import _translate
Expand Down
4 changes: 2 additions & 2 deletions src/bitmessageqt/migrationwizard.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python2.7
from PyQt4 import QtGui
from PyQt4 import QtGui # pylint: disable=import-error


class MigrationWizardIntroPage(QtGui.QWizardPage):
Expand All @@ -21,7 +21,7 @@ def nextId(self):


class MigrationWizardAddressesPage(QtGui.QWizardPage):
def __init__(self, addresses):
def __init__(self, addresses): # pylint: disable=unused-argument
super(QtGui.QWizardPage, self).__init__()
self.setTitle("Addresses")

Expand Down
2 changes: 1 addition & 1 deletion src/bitmessageqt/networkstatus.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import time

from PyQt4 import QtCore, QtGui
from PyQt4 import QtCore, QtGui # pylint: disable=import-error

import l10n
import network.stats
Expand Down
2 changes: 1 addition & 1 deletion src/bitmessageqt/retranslateui.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from PyQt4 import QtGui
from PyQt4 import QtGui # pylint: disable=import-error
import widgets


Expand Down
2 changes: 1 addition & 1 deletion src/bitmessageqt/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import tempfile

import six
from PyQt4 import QtCore, QtGui
from PyQt4 import QtCore, QtGui # pylint: disable=import-error

import debug
import defaults
Expand Down
2 changes: 1 addition & 1 deletion src/bitmessageqt/statusbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""Status bar Module"""

from time import time
from PyQt4 import QtGui
from PyQt4 import QtGui # pylint: disable=import-error


class BMStatusBar(QtGui.QStatusBar):
Expand Down
3 changes: 2 additions & 1 deletion src/bitmessageqt/support.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import sys
import time

from PyQt4 import QtCore
from PyQt4 import QtCore # pylint: disable=import-error

import account
import defaults
Expand Down Expand Up @@ -133,6 +133,7 @@ def createSupportMessage(myapp):
architecture = "32" if ctypes.sizeof(ctypes.c_voidp) == 4 else "64"
pythonversion = sys.version

# pylint: disable=protected-access
opensslversion = "%s (Python internal), %s (external for PyElliptic)" % (
ssl.OPENSSL_VERSION, OpenSSL._version)

Expand Down
2 changes: 1 addition & 1 deletion src/bitmessageqt/uisignaler.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

from PyQt4.QtCore import QThread, SIGNAL
from PyQt4.QtCore import QThread, SIGNAL # pylint: disable=import-error
import sys

import queues
Expand Down
6 changes: 3 additions & 3 deletions src/bitmessageqt/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import hashlib
import os

from PyQt4 import QtGui
from PyQt4 import QtGui # pylint: disable=import-error

import state
from addresses import addBMIfNotPresent
Expand Down Expand Up @@ -56,7 +56,7 @@ def identiconize(address):
elif identicon_lib == 'pydenticon':
# Here you could load pydenticon.py
# (just put it in the "src" folder of your Bitmessage source)
from pydenticon import Pydenticon
from pydenticon import Pydenticon # pylint: disable=import-error
# It is not included in the source, because it is licensed under GPLv3
# GPLv3 is a copyleft license that would influence our licensing
# Find the source here:
Expand All @@ -65,7 +65,7 @@ def identiconize(address):
# https://python-pillow.org/
idcon_render = Pydenticon(
addBMIfNotPresent(address) + identiconsuffix, size * 3)
rendering = idcon_render._render()
rendering = idcon_render._render() # pylint: disable=protected-access
data = rendering.convert("RGBA").tostring("raw", "RGBA")
qim = QtGui.QImage(data, size, size, QtGui.QImage.Format_ARGB32)
pix = QtGui.QPixmap.fromImage(qim)
Expand Down
2 changes: 1 addition & 1 deletion src/bitmessageqt/widgets.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from PyQt4 import uic
from PyQt4 import uic # pylint: disable=import-error
import os.path
import paths

Expand Down
Loading