| 83 | |
| 84 | |
| 85 | class Input: |
| 86 | |
| 87 | def __init__(self, handle, unit, label, iconID, defaultValue, defaultRange, mainTooltip=None, secondaryTooltip=None, conditions=()): |
| 88 | self.handle = handle |
| 89 | self.unit = unit |
| 90 | self.label = label |
| 91 | self.iconID = iconID |
| 92 | self.defaultValue = defaultValue |
| 93 | self.defaultRange = defaultRange |
| 94 | self.mainTooltip = mainTooltip |
| 95 | self.secondaryTooltip = secondaryTooltip |
| 96 | # Format: ((x condition, y condition), (x condition, y condition), ...) |
| 97 | self.conditions = tuple(conditions) |
| 98 | |
| 99 | def __hash__(self): |
| 100 | return hash((self.handle, self.unit, self.label, self.iconID, self.defaultValue, self.defaultRange, self.mainTooltip, self.secondaryTooltip, self.conditions)) |
| 101 | |
| 102 | def __eq__(self, other): |
| 103 | if not isinstance(other, Input): |
| 104 | return False |
| 105 | return all(( |
| 106 | self.handle == other.handle, |
| 107 | self.unit == other.unit, |
| 108 | self.label == other.label, |
| 109 | self.iconID == other.iconID, |
| 110 | self.defaultValue == other.defaultValue, |
| 111 | self.defaultRange == other.defaultRange, |
| 112 | self.mainTooltip == other.mainTooltip, |
| 113 | self.secondaryTooltip == other.secondaryTooltip, |
| 114 | self.conditions == other.conditions)) |
| 115 | |
| 116 | |
| 117 | class InputCheckbox: |
no outgoing calls
no test coverage detected