Skip to content

Commit

Permalink
code style updates
Browse files Browse the repository at this point in the history
  • Loading branch information
introkun committed Mar 25, 2024
1 parent dcfd96b commit d06fc75
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -559,5 +559,5 @@ min-public-methods=2

# Exceptions that will emit a warning when being caught. Defaults to
# "BaseException, Exception".
overgeneral-exceptions=BaseException,
Exception
overgeneral-exceptions=builtins.BaseException,
builtins.Exception
12 changes: 7 additions & 5 deletions qt_range_slider/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ def mouseReleaseEvent(self, event):
self._right_thumb.pressed = False
super().mouseReleaseEvent(event)

# pylint: disable=no-self-use
def __get_thumb_value(self, x, canvas_width, right_value):
# pylint: disable=logging-fstring-interpolation
logging.debug(
Expand All @@ -246,12 +245,15 @@ def mouseMoveEvent(self, event):
if thumb.pressed:
if thumb == self._left_thumb:
value_setter = self.set_left_thumb_value
value_adjuster = lambda val: _left_thumb_adjuster(val, 0)

def value_adjuster(val):
return _left_thumb_adjuster(val, 0)

else:
value_setter = self.set_right_thumb_value
value_adjuster = lambda val: _right_thumb_adjuster(
val, self._right_value
)

def value_adjuster(val):
return _right_thumb_adjuster(val, self._right_value)

new_val = self.__get_thumb_value(
event.position().x(), self._canvas_width, self._right_value
Expand Down
1 change: 0 additions & 1 deletion tests/test_slider.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ def test_init(self):
with self.assertRaises(ValueError):
QtRangeSlider(QtRangeSliderTest._form, 0, 10, 5, 3)

# pylint: disable=no-self-use
def test_paint_event(self):
slider = QtRangeSlider(QtRangeSliderTest._form, 0, 10, 3, 5)
_draw_widget(slider)
Expand Down

0 comments on commit d06fc75

Please sign in to comment.