/
gmailGrammar.py
64 lines (62 loc) · 1.95 KB
/
gmailGrammar.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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
from dragonfly import *
import pythoncom
import win32com.client
import time
from vilanGrammars import *
class mainRule(MappingRule):
mapping = {
"archive current [e-mail]" : Key("rbracket"),
"archive" : Key("e"),
"BCC" : Key("cs-b"),
"CC" : Key("cs-c"),
"change label to <label>" : Key("v") + Text("%(label)s\n") + Key("escape, escape"),
"chat with <person>" : Key("q") + Text("%(person)s\n"),
"compose [new] [mail]" : Key("c"),
"compose in new tab" : Key("d"),
"delete e-mail" : Key("hash"),
"delete message" : Key("hash"),
"email <recipient>" : Key("c") + Text("%(recipient)s\n"),
"escape" : Key("escape, escape"),
"focus main window" : Key("c-escape"),
"forward [e-mail]" : Key("f"),
"forward [e-mail] in new tab" : Key("s-f"),
"from <sender>" : Key("cs-f") + Text("%(sender)s\n"),
"label as <label>": Key("l") + Text("%(label)s\n") + Key("escape, escape"),
"label" : Key("l"),
"mark [as] important" : Key("plus"),
"mark [as] read" : Key("s-i"),
"mark [as] unimportant" : Key("minus"),
"mark [as] unread" : Key("s-u"),
"[mark] [report] [as] spam" : Key("bang"),
"next e-mail" : Key("k"),
"next message" : Key("k"),
"next tab" : Key("backtick, down"),
"open chat" : Key("q"),
"open" : Key("o"),
"previous e-mail" : Key("j"),
"previous message" : Key("j"),
"previous tab" : Key("tilde, down"),
"remove" : Key("y"),
"reply [to] all" : Key("a"),
"reply [to] all in new tab" : Key("s-a"),
"reply" : Key("r"),
"reply in new tab" : Key("s-r"),
"return" : Key("u"),
"save [draft]" : Key("c-s"),
"search email [for] <option>" : Key("slash") + Text("%(option)s\n"),
"select e-mail" : Key("x"),
"select message" : Key("x"),
"send [message]" : Key("c-enter"),
"star [e-mail]" : Key("s"),
"undo" : Key("z"),
"update" : Key("s-n"),
}
extras = [
Dictation("recipient"),
Dictation("option"),
Dictation("sender"),
Dictation("label"),
Dictation("person"),
]
rule = mainRule()
gmailGrammar.add_rule(rule)