jythonsikulisikuli-scriptsikuli-idesikuli-x

SikuliX cannot call makeOpts()


I am working on sikulixide-2.0.5 on windows. Now I would like to utilize user properties write/read functions to implement persistence of application parameters, So that I am learning as the part of reference shown : https://sikulix-2014.readthedocs.io/en/latest/globals.html#saveOpts

The question is , whatever I call any persistence-related API with fix term of Opt , for example makeOpts() , the engine would keep answer me following error, How do I get it works?

[error] AttributeError ( 'org.sikuli.script.support.RunTime' object has no attribute 'makeOpts' )

reference code here , pretty simple :

from sikuli import *

def trialOpts():
    obj = makeOpts()
    return

trialOpts()

As contrast , other kind API like click(), find() are working fine without AttributeError message , which means the main engine of Sikuli is exactly running.

Since these are native API of Sikuli , as my understanding , it should not have to import any modules? To make sure of that , I studied bit source codes of Sikuli on Github , the APIs with term Opt were exactly defined there in Sikuli.py :

enter image description here

By far I am running out clues. Please can you help.


Solution

  • Those "*Opts" convenience methods seem to not exist in the 2.0.5 release. It looks like they were refactored out of existence.

    To see what those methods do (and potentially recreate them in jython), see:

    https://www.javatips.net/api/SikuliX-2014-master/API/src/main/java/org/sikuli/script/RunTime.java

    Additionally, it looks like the github project has the code if you pull a pre-2.0.0 tag:

    https://github.com/RaiMan/SikuliX1