Diffusion Krita 3035b737df8c

Update scripter to allow running of scripts without a main() function

Authored by rempt on Dec 20 2017, 10:33 AM.

Description

Update scripter to allow running of scripts without a main() function

Summary:
Allow scripter to play main()-less scripts without complaining

If a script is typed into the scripter window interactively and saved, scripter keeps a record of the file and automatically loads the script on the next run. When you press play on this auto-loaded script the runner module tries to load the module, then run it's main() method. However, an interactive script may not have a main method. Scripter should run main() if it's present, but fail silently if it is not present.

Test Plan:
Not sure what to put here.
To trigger the initial bug Run krita, run scripter, create a script without main, save the script then press the play button.

Reviewers: Krita, woltherav

Reviewed By: Krita, woltherav

Subscribers: alvinhochun, rempt, eliakinalmeida, woltherav

Tags: Krita

Differential Revision: https://phabricator.kde.org/D9317

Merged Changes

CommitAuthorDetailsCommitted
0ba750973419D9317rempt
Update scripter to allow running of scripts without a main() function 
Dec 20 2017