[Sikuli-driver] [Question #660608]: type('`') odd behaviour

2017-11-11 Thread Alex Lunyov
New question #660608 on Sikuli:
https://answers.launchpad.net/sikuli/+question/660608

Hi,

here is some addition to "type invalid key code" questions collection on 
Launchpad. May be a bug.

So, when I just started IDE and executed simple code:

 type('`')  # there is one key to type, backquote (backtick), that belongs 
to American QWERTY layout

I got such an error:

*
[log] TYPE "`"
[error] script [ Безымянный ] stopped with error in line 1
[error] java.lang.IllegalArgumentException ( 
java.lang.IllegalArgumentException: Invalid key code )
*

Next, I corrected the command:

 type(u'`')

and got no errors:

*
[log] TYPE "`"
*

And at last, I deleted unicode prefix and there were no errors again.

Can't understand.

I use latest 1.1.2 nightly version of SikuliX.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


[Sikuli-driver] [Question #660613]: Convert my Sikuli python script in a java (obfuscated) standalone package

2017-11-11 Thread Max
New question #660613 on Sikuli:
https://answers.launchpad.net/sikuli/+question/660613

Hi!

Preface: I'm not a software developer and have never developed anything in java 
:)
I developed some sikuli scripts in python to automate actions for my researches 
(I work in academia).

Now I need to build a java standalone package for one of my programs (with the 
obfuscation) to be able to run it without installing and configure sikuli when 
I move or if I need to lend it to other departments.

I asked already the question here => 
https://stackoverflow.com/questions/47042941/jar-or-exe-file-from-sikuli-python-script
 
 but could not performed already the second step...

I have my script in a folder "my_program.sikuli":

image1.png
image2.png
...
script.py


So far I just compiled my py script with jython obtaining a .class file

$JYTHON_HOME/jython $JYTHON_HOME/Lib/compileall.py   /home/my_program.sikuli/

===> a new file called  "script$py.class" is in /home/my_program.sikuli/

Now I have no idea what to do and how to do it! In the link they spoke about 
wrappers and __run__.py  but cannot understand what to do.

Could you help me explaining step by step the actions?

Thank you very much for your support!!!


-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #660608]: type('`') odd behaviour

2017-11-11 Thread Alex Lunyov
Question #660608 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/660608

Status: Open => Solved

Alex Lunyov confirmed that the question is solved:
OK, I've just resolved the problem. Nothing strange, in fact I use two
layouts and while I run script in English layout the keystroke is
correct. Otherwise it is invalid. So, I have to check the correct layout
before I run the script.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


[Sikuli-driver] [Question #660623]: type('`') odd behaviour II

2017-11-11 Thread Alex Lunyov
New question #660623 on Sikuli:
https://answers.launchpad.net/sikuli/+question/660623

Well, I still need help.

I noticed such strange thing:

type('`') is dependent on _current_ layout before the run button is pressed.

I made a test:

for i in range(10):
try:
type('`')  # backquote typing
except:
print "error"
wait(1)

I set layout to English and run the script. During 10 seconds I change the 
layout manually and see typing of backquotes and other symbol corresponding the 
key '`'.

Then I set layout to Cyrillic and run the script. I see nothing is typed though 
I change the layout to English and back etc. during that 10 seconds.  And after 
10 seconds I see 10 "error" printings.

So, how could I make my script layout independent?

P.S. and type('d') for example is initial-layout independent.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


[Sikuli-driver] [Question #660624]: app.focus() resulting in negative x and y values

2017-11-11 Thread Yongho Lee
New question #660624 on Sikuli:
https://answers.launchpad.net/sikuli/+question/660624

So I'm using app.focus() to focus on an application for memu, and it results in 
an error like this:

[error] Region(-250,-250,125,125) outside any screen - subsequent actions might 
not work as expected
[error] script [ C:\Users\Yongho Lee\Desktop\GFL\GFL.sikuli ] stopped with 
error in line 156
[error] java.lang.NullPointerException ( java.lang.NullPointerException )
[error] --- Traceback --- error source first
line: module ( function ) statement
123: main (  focus_window ) while not 
(memu_window.exists(Pattern('main_menu_home.png').exact())):
145: main (  collect_exped ) focus_window()
[error] --- Traceback --- end --

The problematic portion of the code looks like this:

def focus_window():
global memu_window
myApp = App.focus("MEmu")
memu_window = myApp.focusedWindow()
memu_window.setAutoWaitTimeout(1)
loop_count = 0
while not (memu_window.exists(Pattern('main_menu_home.png').exact())):
myApp = App.focus("MEmu")
memu_window = myApp.focusedWindow()

It's supposed to focus on the memu window and return back its coordinates to 
another function.

The error occurs when the code tries to initiate 
(memu_window.exists(Pattern('main_menu_home.png').exact())), so I'm assuming 
the problem here is app.focus("MEmu") returning negative values. Why does this 
happen and how can I fix it?

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp