| 1 |
#!/usr/bin/env python3 |
| 2 |
# -*- coding: utf-8 -*- |
| 3 |
|
| 4 |
# Fenrir TTY screen reader |
| 5 |
# By Chrys, Storm Dragon, and contributors. |
| 6 |
|
| 7 |
from fenrirscreenreader.core.i18n import _ |
| 8 |
from fenrirscreenreader.core.tabCompletionManager import TabCompletionManager |
| 9 |
|
| 10 |
|
| 11 |
class command: |
| 12 |
def __init__(self): |
| 13 |
self.manager = TabCompletionManager() |
| 14 |
|
| 15 |
def initialize(self, environment): |
| 16 |
self.env = environment |
| 17 |
self.manager.initialize(environment) |
| 18 |
|
| 19 |
def shutdown(self): |
| 20 |
pass |
| 21 |
|
| 22 |
def get_description(self): |
| 23 |
return _("Announces visible tab completion results") |
| 24 |
|
| 25 |
def run(self): |
| 26 |
text = self.manager.process_update() |
| 27 |
if not text: |
| 28 |
return |
| 29 |
|
| 30 |
do_interrupt = True |
| 31 |
if self.env["runtime"]["SettingsManager"].get_setting_as_bool( |
| 32 |
"speech", "auto_read_incoming" |
| 33 |
): |
| 34 |
do_interrupt = False |
| 35 |
|
| 36 |
self.env["runtime"]["OutputManager"].present_text( |
| 37 |
text, |
| 38 |
interrupt=do_interrupt, |
| 39 |
announce_capital=True, |
| 40 |
flush=False, |
| 41 |
) |
| 42 |
|
| 43 |
def set_callback(self, callback): |
| 44 |
pass |