More pylint fixes

This commit is contained in:
Florian Bruhin 2014-01-29 08:36:44 +01:00
parent 8870882edd
commit d83b98ecc0
6 changed files with 24 additions and 24 deletions

View File

@ -3,7 +3,6 @@ import os
import logging
from configparser import ConfigParser
# pylint: disable=abstract-class-little-used
config = None
colordict = {}

View File

@ -80,7 +80,7 @@ class CompletionView(QTreeView):
self.model.pattern = ''
self.expandAll()
def resort(self, pattern): # pylint: disable=unused-argument
def resort(self, pattern): # pylint: disable=unused-argument
try:
self.model.sourceModel().sort(0)
except NotImplementedError:
@ -216,7 +216,7 @@ class CompletionItemDelegate(QStyledItemDelegate):
text_rect = text_rect_.adjusted(margin, 0, -margin, 0)
self.painter.save()
state = self.opt.state
if (state & QStyle.State_Enabled and state & QStyle.State_Active):
if state & QStyle.State_Enabled and state & QStyle.State_Active:
cg = QPalette.Normal
elif state & QStyle.State_Enabled:
cg = QPalette.Inactive

View File

@ -9,7 +9,7 @@ class Command(QLineEdit):
"""The commandline part of the statusbar"""
# Emitted when a command is triggered by the user
got_cmd = pyqtSignal(str)
bar = None # The status bar object
statusbar = None # The status bar object
esc_pressed = pyqtSignal() # Emitted when escape is pressed
tab_pressed = pyqtSignal(bool) # Emitted when tab is pressed (arg: shift)
hide_completion = pyqtSignal() # Hide completion window
@ -18,14 +18,13 @@ class Command(QLineEdit):
_histpos = None
# FIXME won't the tab key switch to the next widget?
# See
# noqa http://www.saltycrane.com/blog/2008/01/how-to-capture-tab-key-press-event-with/
# for a possible fix.
# See [0] for a possible fix.
# [0] http://www.saltycrane.com/blog/2008/01/how-to-capture-tab-key-press-event-with/ # noqa # pylint: disable=line-too-long
def __init__(self, bar):
super().__init__(bar)
def __init__(self, statusbar):
super().__init__(statusbar)
# FIXME
self.bar = bar
self.statusbar = statusbar
self.setStyleSheet("border: 0px; padding-left: 1px")
self.setValidator(Validator())
self.returnPressed.connect(self.process_cmd)
@ -72,7 +71,7 @@ class Command(QLineEdit):
def focusInEvent(self, e):
"""Clear error message when the statusbar is focused"""
self.bar.clear_error()
self.statusbar.clear_error()
super().focusInEvent(e)
def _histbrowse_start(self):

View File

@ -6,7 +6,7 @@ from PyQt5.QtCore import QSize
class Progress(QProgressBar):
""" The progress bar part of the status bar"""
bar = None
statusbar = None
color = None
_stylesheet = """
QProgressBar {{
@ -20,9 +20,9 @@ class Progress(QProgressBar):
}}
"""
def __init__(self, bar):
self.bar = bar
super().__init__(bar)
def __init__(self, statusbar):
self.statusbar = statusbar
super().__init__(statusbar)
self.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
self.setTextVisible(False)
@ -37,7 +37,7 @@ class Progress(QProgressBar):
self.setStyleSheet(config.get_stylesheet(self._stylesheet))
def minimumSizeHint(self):
status_size = self.bar.size()
status_size = self.statusbar.size()
return QSize(100, status_size.height())
def sizeHint(self):

View File

@ -23,6 +23,7 @@ class Text(QLabel):
def set_perc(self, x, y):
"""Setter to be used as a Qt slot"""
# pylint: disable=unused-argument
if y == 0:
self.scrollperc = '[top]'
elif y == 100:

View File

@ -66,16 +66,17 @@ def _check_crlf(fn):
pylint_disable = [
'import-error', # import seems unreliable
'import-error', # import seems unreliable
'no-name-in-module',
'invalid-name', # short variable names can be nice
'star-args', # we want to use this
'fixme', # I'll decide myself when to fix them
'too-many-public-methods', # Basically unavoidable with Qt
'no-self-use', # I'll decide that myself, thanks
'super-on-old-class', # These don't even exist in python3
'invalid-name', # short variable names can be nice
'star-args', # we want to use this
'fixme', # I'll decide myself when to fix them
'too-many-public-methods', # Basically unavoidable with Qt
'no-self-use', # I'll decide that myself, thanks
'super-on-old-class', # These don't even exist in python3
'old-style-class',
'global-statement', # Sometimes necessary
'global-statement', # Sometimes necessary
'abstract-class-little-used', # False-positives
]
flake8_disable = [