Skip to content

Commit

Permalink
Spices.py: Catch and ignore actions with missing Name fields.
Browse files Browse the repository at this point in the history
  • Loading branch information
mtwebster committed Sep 12, 2024
1 parent c7eedb1 commit f32fbb0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions files/usr/share/cinnamon/cinnamon-settings/bin/Spices.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ def _load_metadata(self):
try:
keyfile.load_from_file(full_path, GLib.KeyFileFlags.KEEP_TRANSLATIONS)
except GLib.Error as e:
print("Could not read action file '%s': %s" % (full_path,e.message))
print("Could not read action file '%s': %s" % (full_path, e.message))
continue

try:
Expand All @@ -465,8 +465,12 @@ def _load_metadata(self):
if e.code == GLib.KeyFileError.NOT_FOUND:
pass

name = keyfile.get_locale_string('Nemo Action', 'Name')
metadata['name'] = name.replace("_", "")
try:
name = keyfile.get_locale_string('Nemo Action', 'Name')
metadata['name'] = name.replace("_", "")
except GLib.Error as e:
print("Could not read Name field for action. Skipping '%s': %s" % (full_path, e.message))
continue

try:
metadata['description'] = keyfile.get_locale_string('Nemo Action', 'Comment')
Expand Down

0 comments on commit f32fbb0

Please sign in to comment.