Code changes made in IDE aren't reflected when you hit Run

Asked by Shanya

This issue has occurred in 1.1.0 and 1.1.1 on several operating systems (Ubuntu 14.04 and 15.10, OSX 10.10 and 10.11, Windows 7, 8.1, and 10), and since this issue is cross-version and cross-platform I'm certain it's something I'm doing wrong and not a bug.

When you change code in the IDE, save, and then hit Run, Sikuli will run the version of the program as it existed when the IDE originally loaded. The only way to force the IDE to run any changes is to make the changes, save, hit Run, exit the IDE, restart the IDE, and then hit Run again - then (and only then) will Sikuli use the new, altered version of the code when it executes. This is annoying because one of my oldest habits is to add in a debug message such as popup("The value of the variable in question is " + str(var)), or adding a new logging call in order to investigate a bug or verify a change, but every time I do, Sikuli runs the old version without the debug statement.

(Occasionally, this process has to be repeated twice, and I'm not certain what situations cause this.)

Is there anything I can do different to get the IDE to run altered code without having to restart the IDE every time?

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

-- When you change code in the IDE, save, and then hit Run, Sikuli will run the version of the program as it existed when the IDE originally loaded
This indeed would be odd.
Since I cannot reproduce this behavior with a script that is not imported by another one (hence a main script) I need some proof for this from your side.

In the preferences (more options) there is an option, to generally auto-save scripts before they are run. I always work with this option switched on.

Revision history for this message
Shanya (almafeta) said :
#2

Huh. I'm using scripts that import other scripts (platform-specific code is imported as much as possible instead of creating massive nested ifs), and it's there where I encounter problems.

Do I have to do anything different with imported scripts?

Revision history for this message
RaiMan (raimund-hocke) said :
#3

... and it's there where I encounter problems
yep, that was what I guessed already.
the docs might help:
http://sikulix-2014.readthedocs.io/en/latest/scripting.html#importing-other-sikuli-scripts-reuse-code-and-images

... and since 1.1.1 build of May 20th imported scripts are now automatically reloaded at a new run, when their content has changed.

Can you help with this problem?

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

To post a message you must log in.