Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions cursorless-talon/src/check_community_repo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
from talon import app, registry

required_captures = [
"number_small",
"user.any_alphanumeric_key",
"user.formatters",
"user.ordinals_small",
]

required_actions = [
"user.homophones_get",
"user.reformat_text",
]


def on_ready():
missing_captures = [
capture for capture in required_captures if capture not in registry.captures
]
missing_actions = [
action for action in required_actions if action not in registry.actions
]
errors = []
if missing_captures:
errors.append(f"Missing captures: {', '.join(missing_captures)}")
if missing_actions:
errors.append(f"Missing actions: {', '.join(missing_actions)}")
if errors:
errors.insert(0, "https://github.com/talonhub/community")
message = "\n".join(errors)
app.notify("Cursorless missing community repository", body=message)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we want the errors to be in the app notification; I'd put them in a print so they go in the log. Most people will just be missing community so they won't care which captures they're missing

Also, is it possible to make it so that if they click the notification it goes to community

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have updated the message now.
I don't think there is any click events on the app notification.



app.register("ready", on_ready)
Loading