From 49d34a1593ba02a96b164bc123cc169e687f3944 Mon Sep 17 00:00:00 2001 From: GetPsyched Date: Tue, 16 Jan 2024 14:44:36 +0530 Subject: [PATCH] feat: return chordmaps and success boolean --- charachorder/device.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/charachorder/device.py b/charachorder/device.py index eab1db1..c244ea9 100644 --- a/charachorder/device.py +++ b/charachorder/device.py @@ -147,7 +147,7 @@ def populate_chordmaps( limit: int | None = None, manual_interrupt: Callable[[], bool] = lambda: False, timeout: float | None = None, - ) -> None: + ) -> tuple[list[tuple[Chord, ChordPhrase]], bool]: chordmaps = [] interrupted = False start_time = time.time() @@ -165,6 +165,7 @@ def populate_chordmaps( if not interrupted: self.chordmaps = chordmaps + return chordmaps, interrupted def get_chord_phrase(self, chord: str) -> ChordPhrase | None: phrase = self.execute("CML", "C2", chord)[0]