mirror of
https://github.com/onyx-and-iris/nvda-voicemeeter.git
synced 2024-11-22 10:00:46 +00:00
removes ok_exp
This commit is contained in:
parent
a04b7c5fcf
commit
2de1b379f5
@ -8,12 +8,9 @@ class CBindings:
|
|||||||
bind_cancel_speech = libc.nvdaController_cancelSpeech
|
bind_cancel_speech = libc.nvdaController_cancelSpeech
|
||||||
bind_braille_message = libc.nvdaController_brailleMessage
|
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)
|
retval = fn(*args)
|
||||||
if ok_exp is None:
|
if retval not in ok:
|
||||||
if retval not in ok:
|
|
||||||
raise NVDAVMCAPIError(fn.__name__, retval)
|
|
||||||
elif not ok_exp(retval):
|
|
||||||
raise NVDAVMCAPIError(fn.__name__, retval)
|
raise NVDAVMCAPIError(fn.__name__, retval)
|
||||||
return retval
|
return retval
|
||||||
|
|
||||||
@ -21,7 +18,7 @@ class CBindings:
|
|||||||
class Nvda(CBindings):
|
class Nvda(CBindings):
|
||||||
@property
|
@property
|
||||||
def is_running(self):
|
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):
|
def speak(self, text):
|
||||||
self.call(self.bind_speak_text, text)
|
self.call(self.bind_speak_text, text)
|
||||||
|
Loading…
Reference in New Issue
Block a user