Skip to content
Merged
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
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ignore = bitmessagekivy
[pylint.messages_control]
disable =
invalid-name,bare-except,broad-except,relative-import,
superfluous-parens,bad-option-value
superfluous-parens,bad-option-value,fixme
# invalid-name: needs fixing during a large, project-wide refactor
# bare-except,broad-except: Need fixing once thorough testing is easier
# bad-option-value is for backward compatibility between python 2 and 3
Expand All @@ -42,7 +42,7 @@ ignore = bitmessagekivy
[MESSAGES CONTROL]
disable =
invalid-name,bare-except,broad-except,relative-import,
superfluous-parens,bad-option-value
superfluous-parens,bad-option-value,fixme

[DESIGN]
max-args = 8
Expand Down
228 changes: 108 additions & 120 deletions src/bitmessageqt/__init__.py

Large diffs are not rendered by default.

32 changes: 13 additions & 19 deletions src/bitmessageqt/bitmessageui.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#
# WARNING! All changes made in this file will be lost!

# pylint: disable=attribute-defined-outside-init
from PyQt4 import QtCore, QtGui # pylint: disable=import-error
from bmconfigparser import config
from foldertree import AddressBookCompleter
Expand Down Expand Up @@ -57,6 +56,7 @@ def _translate(context, text, disambig,


class Ui_MainWindow(object):
# pylint: disable=attribute-defined-outside-init
def setupUi(self, MainWindow):
MainWindow.setObjectName(_fromUtf8("MainWindow"))
MainWindow.resize(885, 580)
Expand Down Expand Up @@ -182,7 +182,8 @@ def setupUi(self, MainWindow):
self.horizontalSplitter_3.setCollapsible(1, False)
self.gridLayout.addWidget(self.horizontalSplitter_3)
icon2 = QtGui.QIcon()
icon2.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/inbox.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
icon2.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/inbox.png")),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.tabWidget.addTab(self.inbox, icon2, _fromUtf8(""))
self.send = QtGui.QWidget()
self.send.setObjectName(_fromUtf8("send"))
Expand All @@ -204,7 +205,8 @@ def setupUi(self, MainWindow):
item = QtGui.QTableWidgetItem()
icon3 = QtGui.QIcon()
icon3.addPixmap(
QtGui.QPixmap(_fromUtf8(":/newPrefix/images/addressbook.png")), QtGui.QIcon.Selected, QtGui.QIcon.Off
QtGui.QPixmap(_fromUtf8(":/newPrefix/images/addressbook.png")),
QtGui.QIcon.Selected, QtGui.QIcon.Off
)
item.setIcon(icon3)
self.tableWidgetAddressBook.setHorizontalHeaderItem(0, item)
Expand Down Expand Up @@ -366,7 +368,8 @@ def setupUi(self, MainWindow):
self.labelHumanFriendlyTTLDescription.setSizePolicy(sizePolicy)
self.labelHumanFriendlyTTLDescription.setMinimumSize(QtCore.QSize(45, 0))
self.labelHumanFriendlyTTLDescription.setObjectName(_fromUtf8("labelHumanFriendlyTTLDescription"))
self.horizontalLayout_5.addWidget(self.labelHumanFriendlyTTLDescription, 1, QtCore.Qt.AlignLeft)
self.horizontalLayout_5.addWidget(self.labelHumanFriendlyTTLDescription,
1, QtCore.Qt.AlignLeft)
self.pushButtonClear = QtGui.QPushButton(self.send)
self.pushButtonClear.setObjectName(_fromUtf8("pushButtonClear"))
self.horizontalLayout_5.addWidget(self.pushButtonClear, 0, QtCore.Qt.AlignRight)
Expand All @@ -388,7 +391,8 @@ def setupUi(self, MainWindow):
self.horizontalSplitter.setCollapsible(1, False)
self.gridLayout_7.addWidget(self.horizontalSplitter, 0, 0, 1, 1)
icon4 = QtGui.QIcon()
icon4.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/send.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
icon4.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/send.png")),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.tabWidget.addTab(self.send, icon4, _fromUtf8(""))
self.subscriptions = QtGui.QWidget()
self.subscriptions.setObjectName(_fromUtf8("subscriptions"))
Expand Down Expand Up @@ -691,7 +695,6 @@ def setupUi(self, MainWindow):
MainWindow.setTabOrder(self.textEditMessage, self.pushButtonAddSubscription)

# Popup menu actions container for the Sent page
# pylint: disable=attribute-defined-outside-init
self.sentContextMenuToolbar = QtGui.QToolBar()
# Popup menu actions container for chans tree
self.addressContextMenuToolbar = QtGui.QToolBar()
Expand Down Expand Up @@ -739,7 +742,8 @@ def retranslateUi(self, MainWindow):
self.label_2.setText(_translate("MainWindow", "From:", None))
self.label.setText(_translate("MainWindow", "To:", None))
self.tabWidgetSend.setTabText(
self.tabWidgetSend.indexOf(self.sendDirect), _translate("MainWindow", "Send ordinary Message", None)
self.tabWidgetSend.indexOf(self.sendDirect),
_translate("MainWindow", "Send ordinary Message", None)
)
self.label_8.setText(_translate("MainWindow", "From:", None))
self.label_7.setText(_translate("MainWindow", "Subject:", None))
Expand Down Expand Up @@ -822,17 +826,7 @@ def retranslateUi(self, MainWindow):
self.actionRegenerateDeterministicAddresses.setText(
_translate("MainWindow", "Regenerate deterministic addresses", None)
)
self.actionDeleteAllTrashedMessages.setText(_translate("MainWindow", "Delete all trashed messages", None))
self.actionDeleteAllTrashedMessages.setText(
_translate("MainWindow", "Delete all trashed messages", None))
self.actionJoinChan.setText(_translate("MainWindow", "Join / Create chan", None))
self.updateNetworkSwitchMenuLabel()


if __name__ == "__main__":
import sys

app = QtGui.QApplication(sys.argv)
MainWindow = settingsmixin.SMainWindow()
ui = Ui_MainWindow()
ui.setupUi(MainWindow)
MainWindow.show()
sys.exit(app.exec_())
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
1 change: 1 addition & 0 deletions src/bitmessageqt/tests/test_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import sys
import unittest

# pylint: disable=import-outside-toplevel,unused-import
try:
from PyQt4 import QtCore, QtGui, QtTest
has_qt = True
Expand Down
2 changes: 0 additions & 2 deletions src/bitmessageqt/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,9 @@ def avatarize(address):
lower_default = state.appdata + 'avatars/' + 'default.' + ext.lower()
upper_default = state.appdata + 'avatars/' + 'default.' + ext.upper()
if os.path.isfile(lower_default):
default = lower_default
idcon.addFile(lower_default)
return idcon
elif os.path.isfile(upper_default):
default = upper_default
idcon.addFile(upper_default)
return idcon
# If no avatar is found
Expand Down
2 changes: 1 addition & 1 deletion src/build_osx.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Building osx."""
import os
from glob import glob
from PyQt4 import QtCore
from PyQt4 import QtCore # pylint: disable=import-error
from setuptools import setup

name = "Bitmessage"
Expand Down
1 change: 1 addition & 0 deletions src/class_smtpDeliver.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from email.header import Header

from six.moves import email_mime_text
# pylint: disable=import-error
from six.moves.urllib import parse as urlparse

import queues
Expand Down
7 changes: 6 additions & 1 deletion src/class_sqlThread.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import threading
import time

# pylint: disable=import-error,redefined-builtin
from six.moves.reprlib import repr

try:
Expand All @@ -34,8 +35,12 @@ class sqlThread(threading.Thread):

def __init__(self):
threading.Thread.__init__(self, name="SQL")
self.conn = None
self.cur = None

def run(self): # pylint: disable=too-many-locals, too-many-branches, too-many-statements
# pylint: disable=protected-access,too-many-locals
# pylint: disable=too-many-branches,too-many-statements
def run(self):
"""Process SQL queries from `.helper_sql.sqlSubmitQueue`"""
helper_sql.sql_available = True
config_ready.wait()
Expand Down
2 changes: 2 additions & 0 deletions src/helper_msgcoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def __init__(self, message, encoding=BITMESSAGE_ENCODING_SIMPLE):
else:
raise MsgEncodeException("Unknown encoding %i" % (encoding))

# pylint: disable=no-member
def encodeExtended(self, message):
"""Handle extended encoding"""
try:
Expand Down Expand Up @@ -118,6 +119,7 @@ def decodeExtended(self, data):

try:
tmp = msgpack.loads(tmp)
# pylint: disable=no-member
except (msgpack.exceptions.UnpackException,
msgpack.exceptions.ExtraData):
logger.error("Error msgunpacking message")
Expand Down
2 changes: 1 addition & 1 deletion src/main-android-live.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import state
import sys
from bitmessagemain import main
from termcolor import colored
from termcolor import colored # pylint: disable=import-error
print(colored('kivy is not supported at the moment for this version..',
'red'))
sys.exit()
Expand Down
2 changes: 1 addition & 1 deletion src/mockbm/kivy_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""Mock kivy app with mock threads."""

import os
from kivy.config import Config
from kivy.config import Config # pylint: disable=import-error
from pybitmessage.mockbm import multiqueue
from pybitmessage import state

Expand Down
2 changes: 2 additions & 0 deletions src/openclpow.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def initCL():
del gpus[:]
ctx = False
try:
# pylint: disable=no-member
hash_dt = numpy.dtype([('target', numpy.uint64), ('v', numpy.str_, 73)])
try:
for platform in cl.get_platforms():
Expand Down Expand Up @@ -74,6 +75,7 @@ def openclEnabled():
return bool(enabledGpus)


# pylint: disable=no-member
def do_opencl_pow(hash_, target):
"""Perform PoW using OpenCL"""
output = numpy.zeros(1, dtype=[('v', numpy.uint64, 1)])
Expand Down
2 changes: 1 addition & 1 deletion src/paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def codePath():
return os.path.dirname(__file__)
return (
os.environ.get('RESOURCEPATH')
# pylint: disable=protected-access
# pylint: disable=no-member,protected-access
if frozen == "macosx_app" else sys._MEIPASS)


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

import gi
gi.require_version('Notify', '0.7')
from gi.repository import Notify # noqa:E402 pylint: disable=import-error
from gi.repository import Notify # noqa:E402 pylint: disable=import-error,no-name-in-module

Notify.init('pybitmessage')

Expand Down
2 changes: 1 addition & 1 deletion src/pyelliptic/openssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import ctypes
import sys

# pylint: disable=protected-access
# pylint: disable=no-member,protected-access

OpenSSL = None

Expand Down
2 changes: 1 addition & 1 deletion src/tr.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def translateText(context, text, n=None):
enableGUI = True
if enableGUI:
try:
from PyQt4 import QtCore, QtGui
from PyQt4 import QtCore, QtGui # pylint: disable=import-error
except Exception as err:
print('PyBitmessage requires PyQt unless you want to run it as a daemon'
' and interact with it using the API.'
Expand Down
1 change: 1 addition & 0 deletions src/upnp.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from random import randint
from xml.dom.minidom import Document # nosec B408

# pylint: disable=import-error
from defusedxml.minidom import parseString
from six.moves import http_client as httplib
from six.moves.urllib.parse import urlparse
Expand Down
Loading