clear imported Sikuli Scripts?

Asked by Chase

How can i clear previously imported Sikuli Scripts?
Even after closing Sikuli IDE and reopening it changes to some imported scripts are not taking affect.
So i'm looking for a way to clear previously imported scripts or a way to force a new import to overwrite an old one.

Currently I have this statement in all scripts that are imported:
from sikuli.Sikuli import *
and this statement in all scripts that initiate the import:
import os
myPath = os.path.dirname(getBundlePath())
if not myPath in sys.path:
 sys.path.append(myPath)
import <Sikuli_Script>

I am running on Windows XP and have the latest Sikuli version.

Thanks!

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
Tsung-Hsiang Chang (vgod) said :
#1

Use reload.
See https://bugs.launchpad.net/sikuli/+bug/704981 for the details.

Revision history for this message
Chase (shocktherapysb10) said :
#2

That doesn't seem to help. Maybe i have another issue.
I receive this error:
[error] Stopped [error] An error occurs at line 12 [error] Error message: Traceback (most recent call last): File "C:\DOCUME~1\cwhitten\LOCALS~1\Temp\sikuli-tmp5956336944485410448.py", line 12, in import JN_export File "C:\Program Files\Sikuli X\sikuli-script.jar\Lib\sikuli\SikuliImporter.py", line 42, in load_module File "C:\Program Files\Sikuli X\sikuli-script.jar\Lib\sikuli\SikuliImporter.py", line 26, in _load_module ImportError: Errors in loading sikuli module: JN_export You may need to add "from sikuli.Sikuli import *" in the module. name 'setAutoWaitTimeout' is not defined

JN_export is my sikuli script. The first line has
from sikuli.Sikuli import *
I used to have 'setAutoWaitTimeout' at the begging of the Def function in. I received this error so i just deleted that line and it kept giving me this error, even after restarting the IDE and computer. If i save JN_export.sikuli to another name and impart the other name without any other changes the import works just fine but if i change the name back it gives me this error again. Out of 8 or so scripts i'm importing, i have this issue with 2 and all the rest work just fine. And of course both of the scripts that have problems work find if i change the sikuli file(folder) name.
Any ideas?

thanks!

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

Try to use Sikuli script names without any special characters (only characters and numbers, no underscore or such stuff).
This might be a bug.

I usually use camel casing to get some visual structure into the script names.

BTW: when you restart the IDE or run a script from command line you always start with fresh imports.

Can you help with this problem?

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

To post a message you must log in.