sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #13722
Re: [Question #211412]: Couple of questions regarding how-to
Question #211412 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/211412
Status: Open => Answered
RaiMan proposed the following answer:
--1. changing locale
The only automation possibility (means not programming in Objective-C) is to use the GUI access of Applescript or Sikuli :-), to change the preference settings
the principal way with Applescript:
http://stackoverflow.com/questions/4064647/scripting-system-preferences-language-text
You could run the script from within your Sikuli scripts using os.popen and osascript.
--2: a global in an imported modul
Yes your problem is, that the exec's are processed at import and the change of the locale value afterwords does not effect these imports anymore.
The easiest approach would be to have a def setLocale(locale), that sets the locale inside the module and is called each time, you change the locale.
#Framework file is like this (myFramework.sikuli)
locale = "En-En"
exec("import "+locale)
exec("reload(%s)"%(locale))
exec("from %s import *"%(locale))
def setLocale(loc = "En-En"):
locale = loc
#main file is (main.sikuli)
import myFramework
reload(myFramework)
from myFramework import *
setLocale(sys.argv[1])
--3. logging error
as far as I know, this is a Jython problem.
I remember, that this problem already went through this board, but I cannot find it again.
And there was some workaround for this.
Does it happen also, when you run your script from command line? or only
in IDE?
--
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.