Cthulhu is no longer a fork. Now it is a screen reader written in Golang.
This commit is contained in:
1 parent
a998fe67de
commit
069fc674dc
708 files changed
+112482
-532
No files matched your search
+41
@@ -0,0 +1,41 @@
|
||||
# Private conformance peer: author APIs only; no framing or lifecycle code.
|
||||
import pathlib
|
||||
import sys
|
||||
import threading
|
||||
|
||||
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[3] / "sdk/python"))
|
||||
from cthulhu_tentacle import Command, present, serve
|
||||
|
||||
started = threading.Event()
|
||||
|
||||
|
||||
def echo(cancelled, arguments):
|
||||
return arguments
|
||||
|
||||
|
||||
def fail(cancelled, arguments):
|
||||
raise RuntimeError("private handler details")
|
||||
|
||||
|
||||
def large(cancelled, arguments):
|
||||
return "x" * 65536
|
||||
|
||||
|
||||
def wait(cancelled, arguments):
|
||||
started.set()
|
||||
cancelled.wait()
|
||||
pathlib.Path(sys.argv[1]).write_text("cancelled")
|
||||
|
||||
|
||||
def has_started(cancelled, arguments):
|
||||
return started.wait(2)
|
||||
|
||||
|
||||
commands = [Command("echo", "Echo", "", echo), Command("fail", "Fail", "", fail),
|
||||
Command("large", "Large", "", large), Command("wait", "Wait", "", wait),
|
||||
Command("started", "Started", "", has_started)]
|
||||
if pathlib.Path(sys.argv[1]).name == "presentation":
|
||||
commands.append(Command("present", "Present", "",
|
||||
lambda cancelled, arguments: present(speech="Hello, é猫😀é", braille="Display é猫😀é", uninterruptible=True),
|
||||
presentation=True))
|
||||
serve(commands)
|
||||
Reference in new issue
Block a user