-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
13 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,19 @@ | ||
# import dataclasses | ||
from typing import Optional, Union, Literal | ||
# import json | ||
from typing import Literal | ||
|
||
# List of all valid commands that can be sent to the screenreader | ||
IPC_COMMAND = Literal[ | ||
# Prevent the screenreader from interrupting echoback | ||
"disableSpeechInterruptForCharacters", | ||
"enableSpeechInterruptForCharacters", | ||
|
||
# Prevent the screenreader from interrupting echoback | ||
"disableSpeakTypedWords", | ||
"enableSpeakTypedWords", | ||
|
||
# Prevent the screenreader from speaking unnecessary characters in addition to full echo back | ||
"disableSpeakTypedCharacters", | ||
"enableSpeakTypedCharacters" | ||
|
||
# Play a sound to confirm that the command was received | ||
"debug" | ||
] | ||
|
||
# @dataclasses.dataclass | ||
# class IPC_Setting_Change: | ||
# setting_name: str | ||
# setting_value: Union[str, int, float, bool] | ||
|
||
# def validate(self): | ||
# if not isinstance(self.setting_name, str): | ||
# raise TypeError(f"Invalid setting name type: {type(self.setting_name)}") | ||
# if not isinstance(self.setting_value, (str, int, float, bool)): | ||
# raise TypeError(f"Invalid setting value type: {type(self.setting_value)}") | ||
|
||
# @dataclasses.dataclass | ||
# class IPC_Action: | ||
# action_name: str | ||
# action_args: Optional[list[str]] | ||
|
||
# def validate(self): | ||
# if not isinstance(self.action_name, str): | ||
# raise TypeError(f"Invalid action name type: {type(self.action_name)}") | ||
# if self.action_args is not None and not isinstance(self.action_args, list): | ||
# raise TypeError(f"Invalid action args type: {type(self.action_args)}") | ||
|
||
# class IPC_Payload | ||
# def __init__(self, commands: list[Union[IPC_Setting_Change, IPC_Action]]): | ||
# self.commands = commands | ||
|
||
# def validate(self): | ||
# for command in self.commands: | ||
# if not isinstance(command, (IPC_Setting_Change, IPC_Action)): | ||
# raise TypeError(f"Invalid command type: {type(command)}") | ||
|
||
# def serialize(self): | ||
# return json.dumps([dataclasses.asdict(command) for command in self.commands]) | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters