From 2de1b379f58c6d1f54065141ffff3905d18c4d5a Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Tue, 29 Aug 2023 10:47:09 +0100 Subject: [PATCH] removes ok_exp --- src/nvda_voicemeeter/nvda.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/nvda_voicemeeter/nvda.py b/src/nvda_voicemeeter/nvda.py index c605aee..a9ac398 100644 --- a/src/nvda_voicemeeter/nvda.py +++ b/src/nvda_voicemeeter/nvda.py @@ -8,12 +8,9 @@ class CBindings: bind_cancel_speech = libc.nvdaController_cancelSpeech bind_braille_message = libc.nvdaController_brailleMessage - def call(self, fn, *args, ok=(0,), ok_exp=None): + def call(self, fn, *args, ok=(0,)): retval = fn(*args) - if ok_exp is None: - if retval not in ok: - raise NVDAVMCAPIError(fn.__name__, retval) - elif not ok_exp(retval): + if retval not in ok: raise NVDAVMCAPIError(fn.__name__, retval) return retval @@ -21,7 +18,7 @@ class CBindings: class Nvda(CBindings): @property def is_running(self): - return self.call(self.bind_test_if_running, ok_exp=lambda x: x >= 0) == 0 + return self.call(self.bind_test_if_running) == 0 def speak(self, text): self.call(self.bind_speak_text, text)