Bug 387471

Summary: Scripter script fails if it cannot find previous file
Product: [Applications] krita Reporter: Brendan <bunf2014>
Component: ScriptingAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: 4.0 pre-alpha   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

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