-
-
Notifications
You must be signed in to change notification settings - Fork 320
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
When using vim and saving the file, the python code freaks out and the theme editor window dissapears.
27/11/2023 14:13:34 [DEBUG] The theme file has been updated, the preview window will refresh
Traceback (most recent call last):
File "/home/orzel/clones/turing-smart-screen-python/theme-editor.py", line 263, in <module>
if os.path.getmtime(theme_file) > last_edit_time:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen genericpath>", line 55, in getmtime
FileNotFoundError: [Errno 2] File o directory non esistente: 'res/themes/test/theme.yaml'
I'm not sure about the details, but I think vim handles filesaving differently than other editors. It uses rename instead of overwritting.
I use the following change, which works, but might be considered a hack, or too quick & dirty, I'll let you decide:
if os.path.exists(theme_file) and os.path.getmtime(theme_file) > last_edit_time:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working