Bug 387702 - Permit Scripter to load scripts which don't have a main()
Summary: Permit Scripter to load scripts which don't have a main()
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Scripting (show other bugs)
Version: 4.0 pre-alpha
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-08 07:53 UTC by Brendan
Modified: 2017-12-20 06:12 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Allow scripter to play main()-less scripts without complaining (1.17 KB, patch)
2017-12-08 07:53 UTC, Brendan
Details

Note You need to log in before you can comment on or make changes to this bug.
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?