Skip to content
Snippets Groups Projects
Commit a01f48c8 authored by Lan Dam's avatar Lan Dam
Browse files

trivial modify for type hint and variable name

parent 2d5affef
No related branches found
No related tags found
1 merge request!217Implement dialogs to edit valueColors for 2 multiColorDots plot types
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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment