Skip to content

Commit b65ac4e

Browse files
Check for community installation (#2692)
Related ##1953 ## Checklist - [/] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [/] I have updated the [docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and [cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet) - [/] I have not broken the cheatsheet --------- Co-authored-by: Pokey Rule <[email protected]>
1 parent 84d803e commit b65ac4e

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
from talon import app, registry
2+
3+
required_captures = [
4+
"number_small",
5+
"user.any_alphanumeric_key",
6+
"user.formatters",
7+
"user.ordinals_small",
8+
]
9+
10+
required_actions = [
11+
"user.homophones_get",
12+
"user.reformat_text",
13+
]
14+
15+
16+
def on_ready():
17+
missing_captures = [
18+
capture for capture in required_captures if capture not in registry.captures
19+
]
20+
missing_actions = [
21+
action for action in required_actions if action not in registry.actions
22+
]
23+
errors = []
24+
if missing_captures:
25+
errors.append(f"Missing captures: {', '.join(missing_captures)}")
26+
if missing_actions:
27+
errors.append(f"Missing actions: {', '.join(missing_actions)}")
28+
if errors:
29+
print("\n".join(errors))
30+
app.notify(
31+
"Please install the community repository",
32+
body="https://github.com/talonhub/community",
33+
)
34+
35+
36+
app.register("ready", on_ready)

0 commit comments

Comments
 (0)