From 6e616e3889ca63efdd6d1f0cd6418e0ab638c8b7 Mon Sep 17 00:00:00 2001 From: Nicholas Riley Date: Sat, 7 Sep 2024 16:15:34 -0400 Subject: [PATCH] Display message when encountering core Talon issue with ready callback. --- migration_helpers/migration_helpers.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/migration_helpers/migration_helpers.py b/migration_helpers/migration_helpers.py index e4bbb280dd..ba7bf6f908 100644 --- a/migration_helpers/migration_helpers.py +++ b/migration_helpers/migration_helpers.py @@ -255,7 +255,17 @@ def migrate_custom_csv( def on_ready(): - actions.user.migrate_known_csv_files() + try: + actions.user.migrate_known_csv_files() + except KeyError: + # Due to a core Talon bug, the above action may not be available when a ready callback is invoked. + # (see https://github.com/talonhub/community/pull/1268#issuecomment-2325721706) + notification = ( + "Unable to migrate CSVs to Talon lists.", + "Please quit and restart Talon.", + ) + app.notify(*notification) + print(*notification) app.register("ready", on_ready)