Skip to content

Commit

Permalink
Pylint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
timlinux committed Dec 2, 2023
1 parent d01a0b5 commit 26a2292
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 35 deletions.
20 changes: 10 additions & 10 deletions animation_workbench/easing_preview.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
__revision__ = "$Format:%H$"

from qgis.PyQt.QtWidgets import QWidget
from qgis.PyQt.QtGui import QPainter, QPen, QColor
#from qgis.PyQt.QtGui import QPainter, QPen, QColor
from qgis.PyQt.QtCore import (
QEasingCurve,
QPropertyAnimation,
QPoint,
pyqtSignal,
)
from pyqtgraph import PlotWidget
#from pyqtgraph import PlotWidget
import pyqtgraph as pg
from .utilities import get_ui_class

Expand All @@ -32,18 +32,17 @@ class EasingAnimation(QPropertyAnimation):
so that we can show the preview as a mock chart
https://doc.qt.io/qt-6/qvariantanimation.html#endValue-prop
"""
def __init__(self, target_object, property):
parent = None
super(EasingAnimation, self).__init__()
def __init__(self, target_object, property): # pylint: disable=redefined-builtin
#parent = None
super(EasingAnimation, self).__init__() # pylint: disable=super-with-arguments
self.setTargetObject(target_object)
self.setPropertyName(property)

def interpolated(
self, from_point: QPoint, to_point: QPoint, progress: float
) -> QPoint:
# Linearly interpolate X
# and interpolate Y using the easing
if not type(from_point) == QPoint:
"""Linearly interpolate X and interpolate Y using the easing."""
if not isinstance(from_point) == QPoint:
from_point = QPoint(0, 0)
x_range = to_point.x() - from_point.x()
x = (progress * x_range) + from_point.x()
Expand All @@ -54,7 +53,7 @@ def interpolated(

class EasingPreview(QWidget, FORM_CLASS):
"""
A widget for setting an easing mode
A widget for setting an easing mode.
"""

# Signal emitted when the easing is changed
Expand Down Expand Up @@ -85,7 +84,8 @@ def __init__(self, color="#ff0000", parent=None):
self.chart.hideAxis("left")

def resizeEvent(self, new_size):
super(EasingPreview, self).resizeEvent(new_size)
"""Resize event handler."""
super(EasingPreview, self).resizeEvent(new_size) # pylint: disable=super-with-arguments
width = self.easing_preview.width()
height = self.easing_preview.height()
self.easing_preview_animation.setEndValue(QPoint(width, height))
Expand Down
25 changes: 0 additions & 25 deletions pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
# pygtk.require().
#init-hook=

# Profiled execution.
profile=no

# Add files or directories to the blacklist. They should be base names, not
# paths.
ignore=CVS,script_editor
Expand Down Expand Up @@ -48,11 +45,6 @@ disable=E800,locally-disabled,C0103,no-name-in-module,duplicate-code,import-erro
# mypackage.mymodule.MyReporterClass.
output-format=text

# Put messages in a separate file for each module / package specified on the
# command line instead of printing them on stdout. Reports (if any) will be
# written in a file name "pylint_global.[txt|html]".
files-output=no

# Tells whether to display a full report or only the messages
reports=yes

Expand All @@ -63,23 +55,13 @@ reports=yes
# (RP0004).
evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)

# Add a comment according to your evaluation note. This is used by the global
# evaluation report (RP0004).
comment=no

# Template used to display messages. This is a python new-style format string
# used to format the message information. See doc for all details
#msg-template=


[BASIC]

# Required attributes for module, separated by a comma
required-attributes=

# List of builtins function names that should not be used, separated by a comma
bad-functions=map,filter,apply,input

# Regular expression which should only match correct module names
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$

Expand Down Expand Up @@ -176,9 +158,6 @@ ignore-long-lines=^\s*(# )?<?https?://\S+>?$
# else.
single-line-if-stmt=no

# List of optional constructs for which whitespace checking is disabled
no-space-check=trailing-comma,dict-separator

# Maximum number of lines in a module
max-module-lines=1000

Expand Down Expand Up @@ -256,10 +235,6 @@ max-public-methods=20

[CLASSES]

# List of interface methods to ignore, separated by a comma. This is used for
# instance to not check methods defines in Zope's Interface base class.
ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by

# List of method names used to declare (i.e. assign) instance attributes.
defining-attr-methods=__init__,__new__,setUp

Expand Down

0 comments on commit 26a2292

Please sign in to comment.