Publish the Wine Access protocol on Orca’s service connection and manage helpers per active Wine prefix. Add presentation, dialog capture, documentation, and tests. Preserve the Cthulhu default and shared helper code. Document the single-reader limit and verify Orca cleanup leaves Cthulhu-managed helpers alone. Retain integration artifacts on exceptional failures. Validation: 45 Orca unit tests passed; 11 existing test-environment checks passed; version metadata checks, Python compilation, and staged whitespace checks passed. Full Wine integration and live speech/braille remain unverified here because MinGW, Xvfb, and Orca are unavailable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
25 lines
1.4 KiB
Python
25 lines
1.4 KiB
Python
"""Loads the extension inside Orca's Python and checks the Orca APIs it uses."""
|
|
import inspect, sys
|
|
from pathlib import Path
|
|
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
|
|
from orca import dbus_service, presentation_manager, typing_echo_presenter
|
|
import wine_access
|
|
from wine_access import WineAccess
|
|
|
|
ext = WineAccess()
|
|
assert ext.module_name == "WineAccess"
|
|
registration = dbus_service._ModuleRegistration.from_module_instance("WineAccess", ext)
|
|
assert registration.is_empty(), "Orca would publish its own WineAccess object and clash"
|
|
assert hasattr(ext.controller, "_bus"), "Orca's controller no longer exposes its bus"
|
|
pm = presentation_manager.get_manager()
|
|
assert "kill_flash" in inspect.signature(pm.interrupt_presentation).parameters
|
|
for name in ("present_message", "speak_message", "speak_character", "present_braille_message"):
|
|
assert callable(getattr(pm, name)), name
|
|
echo = typing_echo_presenter.get_presenter()
|
|
for name in ("get_key_echo_enabled", "get_character_echo_enabled", "get_action_keys_enabled",
|
|
"get_alphabetic_keys_enabled", "get_numeric_keys_enabled", "get_punctuation_keys_enabled"):
|
|
assert isinstance(getattr(echo, name)(), bool), name
|
|
print("echo settings: key", echo.get_key_echo_enabled(), "character", echo.get_character_echo_enabled())
|
|
print("helper found:", ext._manager.helper)
|
|
print("PASS: extension loads in Orca 51 and every Orca API it calls exists")
|