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
5 changes: 4 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@ ignore = E722,F841,W503
# pylint honours the [MESSAGES CONTROL] section
# as well as [MASTER] section
[MESSAGES CONTROL]
disable=invalid-name,bare-except,broad-except,superfluous-parens
disable=
invalid-name,bare-except,broad-except,superfluous-parens,
bad-option-value
# 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
max-args = 8
max-attributes = 8

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

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

import helper_inbox
import helper_sent
Expand Down
2 changes: 1 addition & 1 deletion src/bitmessagemain.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# yet contain logic to expand into further streams.

# flake8: noqa:402
# pylint: disable=superfluous-parens
# pylint: disable=superfluous-parens,relative-import
import os
import sys

Expand Down
18 changes: 9 additions & 9 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,relative-import,too-many-lines
import hashlib
import locale
import os
Expand Down Expand Up @@ -239,20 +239,20 @@ def init_inbox_popup_menu(self, connectSignal=True):
QtCore.Qt.CustomContextMenu)
if connectSignal:
self.connect(self.ui.tableWidgetInbox, QtCore.SIGNAL(
'customContextMenuRequested(const QPoint&)'),
self.on_context_menuInbox)
'customContextMenuRequested(const QPoint&)'),
self.on_context_menuInbox)
self.ui.tableWidgetInboxSubscriptions.setContextMenuPolicy(
QtCore.Qt.CustomContextMenu)
if connectSignal:
self.connect(self.ui.tableWidgetInboxSubscriptions, QtCore.SIGNAL(
'customContextMenuRequested(const QPoint&)'),
self.on_context_menuInbox)
'customContextMenuRequested(const QPoint&)'),
self.on_context_menuInbox)
self.ui.tableWidgetInboxChans.setContextMenuPolicy(
QtCore.Qt.CustomContextMenu)
if connectSignal:
self.connect(self.ui.tableWidgetInboxChans, QtCore.SIGNAL(
'customContextMenuRequested(const QPoint&)'),
self.on_context_menuInbox)
'customContextMenuRequested(const QPoint&)'),
self.on_context_menuInbox)

def init_identities_popup_menu(self, connectSignal=True):
# Popup menu for the Your Identities tab
Expand Down Expand Up @@ -291,8 +291,8 @@ def init_identities_popup_menu(self, connectSignal=True):
QtCore.Qt.CustomContextMenu)
if connectSignal:
self.connect(self.ui.treeWidgetYourIdentities, QtCore.SIGNAL(
'customContextMenuRequested(const QPoint&)'),
self.on_context_menuYourIdentities)
'customContextMenuRequested(const QPoint&)'),
self.on_context_menuYourIdentities)

# load all gui.menu plugins with prefix 'address'
self.menu_plugins = {'address': []}
Expand Down
2 changes: 1 addition & 1 deletion src/bitmessageqt/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Account related functions.
"""

# pylint: disable=import-error
from __future__ import absolute_import

import inspect
Expand Down
3 changes: 2 additions & 1 deletion src/bitmessageqt/address_dialogs.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
"""
Dialogs that work with BM address.
"""
# pylint: disable=attribute-defined-outside-init,too-few-public-methods,relative-import
# pylint: disable=attribute-defined-outside-init,too-few-public-methods
# pylint: disable=relative-import,import-error

import hashlib

Expand Down
3 changes: 2 additions & 1 deletion src/bitmessageqt/addressvalidator.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Address validator module.
"""
# pylint: disable=too-many-branches,too-many-arguments
# pylint: disable=import-error,relative-import

from Queue import Empty

Expand Down Expand Up @@ -103,7 +104,7 @@ def returnValid(self):
return QtGui.QValidator.Acceptable
return QtGui.QValidator.Intermediate

def validate(self, s, pos):
def validate(self, s, pos): # pylint: disable=unused-argument
"""Top level validator method"""
if self.addressObject is None:
address = None
Expand Down
2 changes: 1 addition & 1 deletion src/bitmessageqt/bitmessage_icons_rc.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
# WARNING! All changes made in this file will be lost!

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

qt_resource_data = "\
\x00\x00\x03\x66\
Expand Down
23 changes: 13 additions & 10 deletions src/bitmessageqt/messagecompose.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
"""
Message editor with a wheel zoom functionality
"""
# pylint: disable=bad-continuation

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


class MessageCompose(QtGui.QTextEdit):
Expand All @@ -15,18 +14,22 @@ def __init__(self, parent=0):

def wheelEvent(self, event):
"""Mouse wheel scroll event handler"""
if (
QtGui.QApplication.queryKeyboardModifiers() & QtCore.Qt.ControlModifier
) == QtCore.Qt.ControlModifier and event.orientation() == QtCore.Qt.Vertical:
if (QtGui.QApplication.queryKeyboardModifiers()
& QtCore.Qt.ControlModifier) == \
QtCore.Qt.ControlModifier \
and event.orientation() == QtCore.Qt.Vertical:
if event.delta() > 0:
self.zoomIn(1)
else:
self.zoomOut(1)
zoom = self.currentFont().pointSize() * 100 / self.defaultFontPointSize
QtGui.QApplication.activeWindow().statusBar().showMessage(
QtGui.QApplication.translate("MainWindow", "Zoom level %1%").arg(
str(zoom)
)
zoom = self.currentFont().pointSize() \
* 100 \
/ self.defaultFontPointSize
QtGui.QApplication.activeWindow().statusBar(). \
showMessage(
QtGui.QApplication.translate("MainWindow",
"Zoom level %1%").
arg(str(zoom))
)
else:
# in QTextEdit, super does not zoom, only scroll
Expand Down
28 changes: 19 additions & 9 deletions src/bitmessageqt/messageview.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,17 @@ def wheelEvent(self, event):
# super will actually automatically take care of zooming
super(MessageView, self).wheelEvent(event)
if (
QtGui.QApplication.queryKeyboardModifiers() & QtCore.Qt.ControlModifier
) == QtCore.Qt.ControlModifier and event.orientation() == QtCore.Qt.Vertical:
zoom = self.currentFont().pointSize() * 100 / self.defaultFontPointSize
QtGui.QApplication.activeWindow().statusBar().showMessage(_translate(
"MainWindow", "Zoom level %1%").arg(str(zoom)))
QtGui.QApplication.queryKeyboardModifiers()
& QtCore.Qt.ControlModifier) == \
QtCore.Qt.ControlModifier \
and event.orientation() == QtCore.Qt.Vertical:
zoom = self.currentFont().pointSize() \
* 100 \
/ self.defaultFontPointSize
QtGui.QApplication.activeWindow().statusBar().\
showMessage(_translate("MainWindow",
"Zoom level %1%").
arg(str(zoom)))

def setWrappingWidth(self, width=None):
"""Set word-wrapping width"""
Expand Down Expand Up @@ -114,17 +120,21 @@ def lazyRender(self):
self.rendering = True
position = self.verticalScrollBar().value()
cursor = QtGui.QTextCursor(self.document())
while self.outpos < len(self.out) and self.verticalScrollBar().value(
) >= self.document().size().height() - 2 * self.size().height():
while self.outpos < len(self.out) \
and self.verticalScrollBar().value() \
>= self.document().size().height() \
- 2 * self.size().height():
startpos = self.outpos
self.outpos += 10240
# find next end of tag
if self.mode == MessageView.MODE_HTML:
pos = self.out.find(">", self.outpos)
if pos > self.outpos:
self.outpos = pos + 1
cursor.movePosition(QtGui.QTextCursor.End, QtGui.QTextCursor.MoveAnchor)
cursor.insertHtml(QtCore.QString(self.out[startpos:self.outpos]))
cursor.movePosition(QtGui.QTextCursor.End,
QtGui.QTextCursor.MoveAnchor)
cursor.insertHtml(
QtCore.QString(self.out[startpos:self.outpos]))
self.verticalScrollBar().setValue(position)
self.rendering = False

Expand Down
13 changes: 8 additions & 5 deletions src/bitmessageqt/newchandialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
=================================

"""

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

import widgets
from addresses import addBMIfNotPresent
from addressvalidator import AddressValidator, PassPhraseValidator
from queues import (
addressGeneratorQueue, apiAddressGeneratorReturnQueue, UISignalQueue)
from queues import (addressGeneratorQueue,
apiAddressGeneratorReturnQueue,
UISignalQueue)
from tr import _translate
from utils import str_chan

Expand All @@ -37,8 +38,10 @@ def __init__(self, parent=None):
False))

self.timer = QtCore.QTimer()
QtCore.QObject.connect( # pylint: disable=no-member
self.timer, QtCore.SIGNAL("timeout()"), self.delayedUpdateStatus)
# pylint: disable=no-member
QtCore.QObject.connect(self.timer,
QtCore.SIGNAL("timeout()"),
self.delayedUpdateStatus)
self.timer.start(500) # milliseconds
self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
self.show()
Expand Down
2 changes: 1 addition & 1 deletion src/bitmessageqt/settingsmixin.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


class SettingsMixin(object):
Expand Down
4 changes: 4 additions & 0 deletions src/bitmessageqt/tests/addressbook.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
"""
Test PyQt addressbook
"""
# pylint: disable=relative-import
import helper_addressbook
from bitmessageqt.support import createAddressIfNeeded

Expand Down
2 changes: 1 addition & 1 deletion src/bitmessageqt/tests/main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Common definitions for bitmessageqt tests"""

# pylint: disable=import-error
import sys
import unittest

Expand Down
1 change: 1 addition & 0 deletions src/bitmessageqt/tests/settings.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for PyBitmessage settings"""
# pylint: disable=import-error
import threading
import time

Expand Down
7 changes: 5 additions & 2 deletions src/bitmessageqt/tests/support.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
"""
PyQt4 test for support request dialog
"""
# pylint: disable=relative-import
# from PyQt4 import QtTest

import sys

from shared import isAddressInMyAddressBook

from main import TestBase
from shared import isAddressInMyAddressBook


class TestSupport(TestBase):
Expand Down
2 changes: 1 addition & 1 deletion src/bmconfigparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from six.moves import configparser

try:
import state
import state # pylint: disable=relative-import
except ImportError:
from pybitmessage import state

Expand Down
2 changes: 1 addition & 1 deletion src/class_addressGenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from binascii import hexlify

from six.moves import configparser, queue
# pylint: disable=import-error
# pylint: disable=import-error,relative-import
import defaults
import highlevelcrypto
import queues
Expand Down
1 change: 1 addition & 0 deletions src/class_singleWorker.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""
# pylint: disable=protected-access,too-many-branches,too-many-statements
# pylint: disable=no-self-use,too-many-lines,too-many-locals
# pylint: disable=relative-import,import-error,redefined-builtin

from __future__ import division

Expand Down
Loading