Updates to Scripter Python Editor

Ahoy Krito-scripto-nauts!

I have recently added a UI improvements to the Python Editor in Krita’s Scripter tool. These are currently in the Krita master and should be available in tonight’s nightly build if you are Windows.   Technically, as these are changes to Python scripts that are shipped with Krita, you don’t need to recompile/reinstall, although that is probably the least complicated thing to do.

What do they do?

  • Allow Scripter to run on Python 3.4 systems. If you are using Windows or an appimage this won’t matter to you because Python is packaged with a high enough version of Python. However, if you’re on a system that is stuck on Python 3.4 (Hello OpenSuSE) you’re going to need this to use the scripter.
  • Use a monospace font in the Output window. Which makes it easier to…
  • Improve error reporting, by showing location of your error in the output window. Previously Scripter would pop up a window dialog telling you the error and the line where it occurred (depending on the type of error), but without any code context. This change also means you don’t have to close a dialog box before correcting your error.
  • Add indent/dedent to the editor. Previously, pressing tab inserted 4 spaces, and shift tab cycled through widgets in the Scripter dialog. Now you can indent and dedent your code blocks. Woo!
  • Adds auto-indent. The editor will now do it’s best to indent new lines to an appropriate indent level automatically (previously each new line started at column 0)
  • Adds toggle comment functionality. Select some text and press Ctrl-M to comment it out (or uncomment it if it is already commented). Keep pressing it all day if you get bored.

If you can’t wait to get the new builds or can’t be bothered recompiling you can get the three new Python files and replace them in your existing Krita directory – <krita_install>/share/krita/pykrita/scripter/ui_scripter

tabwidgets/outputwidget/outputtextedit.py

actions/runaction/runaction.py

editor/pythoneditor.py

Just download the raw file (there is a link in the box to the right) and replace the corresponding file in your directory structure with these new file.

 

 

Leave a comment