| 53 | |
| 54 | |
| 55 | class XDef: |
| 56 | |
| 57 | def __init__(self, handle, unit, label, mainInput, selectorLabel=None, hidden=False): |
| 58 | self.handle = handle |
| 59 | self.unit = unit |
| 60 | self.label = label |
| 61 | self.mainInput = mainInput |
| 62 | self._selectorLabel = selectorLabel |
| 63 | self.hidden = hidden |
| 64 | |
| 65 | @property |
| 66 | def selectorLabel(self): |
| 67 | if self._selectorLabel is not None: |
| 68 | return self._selectorLabel |
| 69 | return self.label |
| 70 | |
| 71 | def __hash__(self): |
| 72 | return hash((self.handle, self.unit, self.label, self.mainInput, self._selectorLabel)) |
| 73 | |
| 74 | def __eq__(self, other): |
| 75 | if not isinstance(other, XDef): |
| 76 | return False |
| 77 | return all(( |
| 78 | self.handle == other.handle, |
| 79 | self.unit == other.unit, |
| 80 | self.label == other.label, |
| 81 | self.mainInput == other.mainInput, |
| 82 | self._selectorLabel == other._selectorLabel)) |
| 83 | |
| 84 | |
| 85 | class Input: |
no outgoing calls
no test coverage detected