Bug 387471 - Scripter script fails if it cannot find previous file
Summary: Scripter script fails if it cannot find previous file
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Scripting (other bugs)
Version First Reported In: 4.0 pre-alpha
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-30 13:57 UTC by Brendan
Modified: 2017-12-04 19:37 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brendan 2017-11-30 13:57:22 UTC
If you save your script from the scripter text edit window it will keep a note of the location and attempt to load it on next startup. If the file is moved or deleted in the interim, file loading will fail and scripter will not initialise.
Comment 1 wolthera 2017-12-04 19:37:47 UTC
Git commit 34954be8baa799dbd0299235ec068e89e1d84afb by Wolthera van Hövell tot Westerflier.
Committed on 04/12/2017 at 19:35.
Pushed by woltherav into branch 'master'.

Adjust settings loading a bit.

1. First off, when there's no document, save an empty string.
2. Then, make sure to check if the filepath exists.
3. Also save and load the pointsize of the editor.

M  +6    -3    plugins/extensions/pykrita/plugin/plugins/scripter/ui_scripter/editor/pythoneditor.py
M  +14   -6    plugins/extensions/pykrita/plugin/plugins/scripter/uicontroller.py

https://commits.kde.org/krita/34954be8baa799dbd0299235ec068e89e1d84afb