IDE needs to be able to rerun the last line

Asked by Zeks

Having extensively worked with sikuli the last 2 weeks I think IDE lacks 2 very important features:
1) reload imported scripts
2) rerun last line

My workflow usually goes like that:
 -- some lengthy script executes but fails at some line in the middle
 -- I try commenting out lines before this one
    -- this in itself is a feat as IDE does not highlight lines commented with '''
    -- I fail as IDE fails to save script (see my previous bug) (not always)
    -- If it does not fail to save I try to rerun the line to make sure there were no problems due to elements being slow to appear
    -- if it is a legitimate error in imported script that I wrote, I fix it and HAVE TO RELAUNCH THE IDE
    -- I relaunch and rerun the script
      -- the script has to do all the init stuff again before it can run the problematic line

There are a lot of unnecessary actions above. relaunching the IDE, reinitializing anchor points pre-script execution, having to comment out chunks of code so that I don't have to run the whole script up to this line again...

Could we please have the ide that does not require all that?:)

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

at 1)
see docs: http://sikulix-2014.readthedocs.org/en/latest/scripting.html#importing-other-sikuli-scripts-reuse-code-and-images
No need to restart the IDE, when imported scripts are changed.

at 2)
If you want to skip parts of your code on rerun, then you should simply organize it like this for example:

- steps run sequentially:

startWith = 0

if startwith < 1:
    # run code for step 0

if startwith < 2:
    # run code for step 1

if startwith < 3:
    # run code for step 2

…. and so on

so on rerun you decide to skip steps 0 and 1, you simply have to change the line
startWith = 2

There are many other possibilities to organize your code into steps and modules/functions.
Another option is to use the unit test feature.

No need to fiddle around with comment/uncomment.

For debugging purposes the SikuliX IDE is not useable anyway. If you need that, you have to use an IDE like Eclipse with plugin PyDev.

Can you help with this problem?

Provide an answer of your own, or ask Zeks for more information if necessary.

To post a message you must log in.