-
Notifications
You must be signed in to change notification settings - Fork 5
/
commands.py
25 lines (20 loc) · 951 Bytes
/
commands.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"""The module imports all other command modules.
It also defines some miscellaneous commands itself.
"""
from gonotego.common import events
from gonotego.common import interprocess
from gonotego.command_center import assistant_commands # noqa: F401
from gonotego.command_center import custom_commands # noqa: F401
from gonotego.command_center import note_commands # noqa: F401
from gonotego.command_center import settings_commands # noqa: F401
from gonotego.command_center import system_commands # noqa: F401
from gonotego.command_center import twitter_commands # noqa: F401
from gonotego.command_center import registry
register_command = registry.register_command
@register_command('r')
@register_command('read')
def read_latest():
note_events_queue = interprocess.get_note_events_queue()
note_event_bytes = note_events_queue.latest()
note_event = events.NoteEvent.from_bytes(note_event_bytes)
system_commands.say(note_event.text)