More pylint fixes
This commit is contained in:
parent
8870882edd
commit
d83b98ecc0
@ -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 = {}
|
||||||
|
@ -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
|
||||||
|
@ -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):
|
||||||
|
@ -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):
|
||||||
|
@ -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:
|
||||||
|
@ -76,6 +76,7 @@ pylint_disable = [
|
|||||||
'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 = [
|
||||||
|
Loading…
Reference in New Issue
Block a user