Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
C-Loftus committed Jan 28, 2024
1 parent 06b3437 commit ec5dde7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions core/addon_communication/ipc_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,12 @@ def addon_server_endpoint() -> Tuple[str, str, str]:
return address, port, valid_commands


def send_ipc_commands(commands: list[str]):
def send_ipc_commands(commands: list[str] | str):
"""Sends a list of commands to the NVDA screenreader"""
ip, port, valid_commands = actions.user.addon_server_endpoint()

if isinstance(commands, str):
commands = [commands]

for command in commands:
if command not in valid_commands:
Expand All @@ -68,6 +70,8 @@ def send_ipc_commands(commands: list[str]):
response = sock.recv(1024)
if settings.get("user.addon_debug"):
print('Received', repr(response))
if command == ['debug'] or command == 'debug':
actions.user.tts("Sent Message to NVDA Successfully")
except socket.timeout:
print("NVDA Addon Connection timed out")
except:
Expand All @@ -86,5 +90,3 @@ def send_ipc_commands(commands: list[str]):
JAWSContext.matches = r"""
tag: user.jaws_running
"""


2 changes: 1 addition & 1 deletion nvda/nvda.talon
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,4 @@ restart reader:
user.restart_nvda()

test reader add on:
user.send_ipc_command("debug")
user.send_ipc_commands("debug")

0 comments on commit ec5dde7

Please sign in to comment.