From 0fcd13f55225c4545d828e1898c219ef3cae578f Mon Sep 17 00:00:00 2001 From: Nick Brassel Date: Wed, 22 Nov 2023 12:08:26 +1100 Subject: [CLI] Remove duplicates from search results (#22528) --- lib/python/qmk/build_targets.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib/python/qmk/build_targets.py') diff --git a/lib/python/qmk/build_targets.py b/lib/python/qmk/build_targets.py index fc72022049..16a7ef87a2 100644 --- a/lib/python/qmk/build_targets.py +++ b/lib/python/qmk/build_targets.py @@ -31,6 +31,17 @@ class BuildTarget: def __repr__(self): return f'BuildTarget(keyboard={self.keyboard}, keymap={self.keymap})' + def __eq__(self, __value: object) -> bool: + if not isinstance(__value, BuildTarget): + return False + return self.__repr__() == __value.__repr__() + + def __ne__(self, __value: object) -> bool: + return not self.__eq__(__value) + + def __hash__(self) -> int: + return self.__repr__().__hash__() + def configure(self, parallel: int = None, clean: bool = None, compiledb: bool = None) -> None: if parallel is not None: self._parallel = parallel -- cgit v1.2.3