Skip to content

Commit

Permalink
better debugging info
Browse files Browse the repository at this point in the history
  • Loading branch information
C-Loftus committed Jan 29, 2024
1 parent 640605b commit 3e5c2ad
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion nvda/nvda.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,15 @@ def is_nvda_running() -> bool:
'''Returns true if NVDA is running'''
if os.name != 'nt' or not nvda_client:
return False

NVDA_RUNNING_CONSTANT = 0
return True if nvda_client.nvdaController_testIfRunning() == NVDA_RUNNING_CONSTANT else False
CLIENT_RESPONSE = nvda_client.nvdaController_testIfRunning()
if CLIENT_RESPONSE == NVDA_RUNNING_CONSTANT:
return True
else:
if settings.get("user.addon_debug"):
print(f"NVDA is not running: {CLIENT_RESPONSE}")
return False

def nvda_tts(text: str, use_clipboard: bool= False):
'''text to speech with NVDA'''
Expand Down

0 comments on commit 3e5c2ad

Please sign in to comment.