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 import logging
from configparser import ConfigParser from configparser import ConfigParser
# pylint: disable=abstract-class-little-used
config = None config = None
colordict = {} colordict = {}

View File

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

View File

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

View File

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

View File

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

View File

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