Bug 387702

Summary: Permit Scripter to load scripts which don't have a main()
Product: [Applications] krita Reporter: Brendan <bunf2014>
Component: ScriptingAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: wishlist CC: griffinvalley, halla
Priority: NOR    
Version: 4.0 pre-alpha   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Allow scripter to play main()-less scripts without complaining

Description Brendan 2017-12-08 07:53:55 UTC
Created attachment 109254 [details]
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. 

Patch attached.
Comment 1 Halla Rempt 2017-12-08 11:01:29 UTC
Hi Brendan!

That looks pretty useful. I guess it's time for you to make an account for phabricator.kde.org, and start putting your patches there for easier review!
Comment 2 Brendan 2017-12-10 20:55:21 UTC
Ok, thanks.
Not sure how I do that. 
So I set up an identity at kde, install arc, and then log in to phabricator?
Comment 3 Halla Rempt 2017-12-10 21:00:11 UTC
Arc isn't strictly needed, but yes, you'd need a kde identity (unfortunately, that's still separate from bugs.kde.org), and add your patches to phabricator. You can do that manually, without arc; I don't use arc either.
Comment 4 Brendan 2017-12-13 05:45:14 UTC
Turns out I already have an identity. Now I have a phabricator account.
So, next question - what's the process? I'm not a heavy git user.
 
I git clone the phabricator then make and commit changes then make pull requests?
 
I plan on working on the scripts in my install directory then copying them to the relevant git directory then git diffing them. Is that a problem?
Comment 5 wolthera 2017-12-13 15:29:02 UTC
The last thing shouldn't be a problem.

For the review request, make a diff, go to differential-> create differential(upper right corner) and then upload the diff. Set the repository to krita, verify the diff, make a description and add 'krita' to the reviewers.
Comment 6 Brendan 2017-12-13 21:06:44 UTC
Have tried to create a diff:
https://phabricator.kde.org/D9317

Do I need to also git fork and commit? If I make further changes to the runaction file how do I make sure the diffs are properly synced?