diff --git a/sohstationviewer/view/db_config/value_color_helper/edit_value_color_dialog/multi_color_dot_dialog.py b/sohstationviewer/view/db_config/value_color_helper/edit_value_color_dialog/multi_color_dot_dialog.py index 492ada7976555c6a45dbc4801498ea79760a1893..58e1d594f66e1bf16175a7a0be92333060243e98 100644 --- a/sohstationviewer/view/db_config/value_color_helper/edit_value_color_dialog/multi_color_dot_dialog.py +++ b/sohstationviewer/view/db_config/value_color_helper/edit_value_color_dialog/multi_color_dot_dialog.py @@ -1,7 +1,7 @@ import sys import platform import os -from typing import List, Dict +from typing import List, Dict, Optional from PySide2 import QtWidgets, QtCore, QtGui from PySide2.QtWidgets import QWidget @@ -23,14 +23,14 @@ class BoundValidator(QtGui.QValidator): Value '-' to allow typing negative float. If user type '-' only, it will be checked when editing is finished. """ - def validate(self, input, pos): - if input in ['', '-']: + def validate(self, input_val, pos): + if input_val in ['', '-']: return QtGui.QValidator.Acceptable try: - input = float(input) + input_val = float(input_val) except ValueError: return QtGui.QValidator.Invalid - if -10 <= input <= 10: + if -10 <= input_val <= 10: return QtGui.QValidator.Acceptable else: return QtGui.QValidator.Invalid @@ -38,7 +38,8 @@ class BoundValidator(QtGui.QValidator): class MultiColorDotDialog(EditValueColorDialog): def __init__( - self, parent: QWidget, value_color_str: str, upper_equal: bool): + self, parent: Optional[QWidget], + value_color_str: str, upper_equal: bool): """ Dialog to edit color for Multi-color Dot Plot