[2.0.5] after changing a method imported inside another method, IDE restart needed

Asked by Filipe Barbosa

confirmed: auto reload for imported methods only works for the 1st level below main.

workaround: run the main script in parallel with the IDE from command line, while editing and saving script content in the IDE.

caveat: you will have the startup delay of some seconds with every run from command line.

-------------------------------------------------------------------------------------

this is my code:
_____________________________________

#main.sikuli
from sikuli import *
import sys
import sub1

sub1.dotest1()
_____________________________________
#sub1.sikuli
from sikuli import *
import sys
import sub2

def dotest1():
    sub2.finalteste()
_____________________________________
#sub2.sikuli
from sikuli import *
import sys

def finaltest():
    print("test x")
________________________________________

if i change print("test x") for ("text y")after i run main.sikuli i get the error:

[error] IDE: Run Script: internal error:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'sub2' is not defined

Question information

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

BTW:
from sikuli import *
import sys
... not needed in main script

--- possible solution:
- import everything in main
- use the deeper level via parameter

#main.sikuli
import sub1
import sub2
sub1.dotest1(sub2)

#sub1.sikuli
from sikuli import *
def dotest1(pack):
    pack.finalteste()

#sub2.sikuli
from sikuli import *
def finaltest():
    print("test x")

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

no feedback