1
0
mirror of https://github.com/altlinux/gpupdate.git synced 2025-03-21 18:50:38 +03:00

Corrected the interpretation of the terminal attribute for shortcuts

This commit is contained in:
Valery Sinelnikov 2024-04-09 18:20:35 +04:00
parent e413f95633
commit b439e04a2f

View File

@ -273,7 +273,9 @@ class shortcut:
if self.type == TargetType.URL:
self.desktop_file.set('URL', desktop_path)
else:
terminal_state = bool(self.desktop_file.get('Terminal'))
str2bool_lambda = (lambda boolstr: boolstr if isinstance(boolstr, bool)
else boolstr and boolstr.lower() in ['True', 'true', 'yes', '1'])
terminal_state = str2bool_lambda(self.desktop_file.get('Terminal'))
self.desktop_file.set('Terminal', 'true' if terminal_state else 'false')
self.desktop_file.set('Exec', '{} {}'.format(desktop_path, self.arguments))
self.desktop_file.set('Comment', self.comment)