Re: [Sikuli-driver] [Question #252512]: How to use regions properly

2014-08-02 Thread Eugene S
Question #252512 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/252512

Eugene S posted a new comment:
@ RaiMan

I completely agree with your comment. 
I just wanted to show the concept here  but clearly, the approach you mentioned 
should be used for better efficiency.

Eugene

-- 
You received this question notification because you are a member of
Sikuli Drivers, which 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 #251795]: Sikuli don't click

2014-08-02 Thread Launchpad Janitor
Question #251795 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/251795

Status: Open = Expired

Launchpad Janitor expired the question:
This question was expired because it remained in the 'Open' state
without activity for the last 15 days.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which 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 #252490]: [1.0.1] Sikuli integration Robot framework --- use sikuli-java.jar

2014-08-02 Thread Greg
Question #252490 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/252490

Status: Answered = Open

Greg is still having a problem:
I setup again 1.0.1 and got sikuli-java.jar 
But now when i run testrun.bat I got the folowing message : no main manifest 
attribute, in sikuli-java.jar

-- 
You received this question notification because you are a member of
Sikuli Drivers, which 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 #252490]: [1.0.1] Sikuli integration Robot framework --- use sikuli-java.jar

2014-08-02 Thread Greg
Question #252490 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/252490

Greg gave more information on the question:

I added 'Main-Class: org.sikuli.script.SikuliX' in 'MANIFEST.MF', and
then run 'java -jar sikuli-java.jar -r test.sikuli' from cmd.

and I got the following exception :

C:\work\calc_step1runtest.bat
Exception in thread main java.util.ServiceConfigurationError: org.sikuli.basic
s.IScriptRunner: Provider org.sikuli.scriptrunner.JythonScriptRunner not found
at java.util.ServiceLoader.fail(Unknown Source)
at java.util.ServiceLoader.access$300(Unknown Source)
at java.util.ServiceLoader$LazyIterator.next(Unknown Source)
at java.util.ServiceLoader$1.next(Unknown Source)
at org.sikuli.basics.SikuliX.getScriptRunner(SikuliX.java:193)
at org.sikuli.basics.FileManager.getScriptFile(FileManager.java:566)
at org.sikuli.basics.SikuliScript.main(SikuliScript.java:171)
at org.sikuli.script.SikuliX.main(SikuliX.java:50)

-- 
You received this question notification because you are a member of
Sikuli Drivers, which 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 #252490]: [1.0.1] Sikuli integration Robot framework --- use sikuli-java.jar

2014-08-02 Thread RaiMan
Question #252490 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/252490

Status: Open = Answered

RaiMan proposed the following answer:
sikuli-java.jar is not runnable and cannot run scripts, because it does
not contain Jython. But that's the intention ;-)

To run your script, you have to use the external Jython that you should
have and put sikuli-java.jar on the class path.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which 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] [Bug 1350735] Re: [request] want options to redirect Sikuli's log messages to my own logging

2014-08-02 Thread Lev
I see the newly added methods in
http://nightly.sikuli.de/docs/index.html

I am not sure where to find the nightly download of the corresponding jar 
though.
I can't seem to find anything new in https://launchpad.net/sikuli/+download or 
other links.

By the way, I downloaded  sikulix-1.1.0.1.gem thinking maybe it had something 
new (earlier I was using the lib/sikulix.rb that was created by the setup jar) 
and noticed that it is not compatible with the sikulxapi.jar because the 
sikulix.rb in there has 
  java_import org.sikuli.basics.SikuliX 
instead of 
  java_import org.sikuli.basics.Sikulix

-- 
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to Sikuli.
https://bugs.launchpad.net/bugs/1350735

Title:
  [request] want options to redirect Sikuli's log messages to my own
  logging

Status in Sikuli:
  In Progress

Bug description:
  A previous thread that is closest to answering my current question is:
  https://answers.launchpad.net/sikuli/+question/248604
  in which RaiMan suggest the usage of a setSikuliXLogCallback

  I searched the net for setSikuliXLogCallback, but the only hit I got
  was that thread.  Hence this question/plea for more detail.

  I recently started looking into Sikuli using IDE first, then I moved onto 
using standalone Jython, and then finally had the courage to venture into using 
Ruby, which is the primary language of my test framework.
  I was pleasantly surprised how easy and great the interface was. Kudos to 
RaiMan and contributors on this great tool.

  Now, onto my question...
  I can redirect the java output to a single log file via 
Debug.setLogFile(log_file). 
  My test framework, however, uses Log4R which direct the log output to 
multiple files as well as the console. 
  Ideally I would like to redirect the logging requests to my logger to do it's 
thing, so that I can get all the output like:
  [LOG] CLICK on L(27,10)@S(0)[0,0 1440x900]
  in the standard log files.

  I kind-a implemented a workaround that does this as follows:
  1. I put in a one-line callback patch in the native_exception_protect() 
method  in the sikulix.rb  file, like this:
  m.bind(self).call(*args)  # previous existing line
  SikuliX4Ruby.post_region_callback(m) if 
SikuliX4Ruby.respond_to?(:post_region_callback)  # line added

  2.  Redirected the java logs to a temp file first, by defining and calling 
the following:
  module SikuliLib
 def self.log_file=(log_file)
  @@log_file = log_file
  Debug.setLogFile(log_file)
  end

  3.  Captured the original logoutput and logged it via myLogger as such:
  module SikuliX4Ruby
def self.post_region_callback(method = nil, obj =nil)
  file = SikuliLib.log_file
  File.readlines(file).each { |line| myLogger.info(line.chomp) } if 
File.size?(file)
  FileUtils.rm file
end
  end

  My workaround does the trick for now, but I'm not happy about the fact that I 
had to copy and patch the sikulix.rb file.
  I would rather not muck with original SikuliX distribution files and use a 
callback that is officially supported, if there is one (The previous question 
thread hinted that there might be one already.)

To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/1350735/+subscriptions

___
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] [Bug 1350735] Re: [request] want options to redirect Sikuli's log messages to my own logging

2014-08-02 Thread RaiMan
start here:
http://sikulix.com

button nightly builds

there you find everything.

the current gem:
https://rubygems.org/gems/sikulix

-- 
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to Sikuli.
https://bugs.launchpad.net/bugs/1350735

Title:
  [request] want options to redirect Sikuli's log messages to my own
  logging

Status in Sikuli:
  In Progress

Bug description:
  A previous thread that is closest to answering my current question is:
  https://answers.launchpad.net/sikuli/+question/248604
  in which RaiMan suggest the usage of a setSikuliXLogCallback

  I searched the net for setSikuliXLogCallback, but the only hit I got
  was that thread.  Hence this question/plea for more detail.

  I recently started looking into Sikuli using IDE first, then I moved onto 
using standalone Jython, and then finally had the courage to venture into using 
Ruby, which is the primary language of my test framework.
  I was pleasantly surprised how easy and great the interface was. Kudos to 
RaiMan and contributors on this great tool.

  Now, onto my question...
  I can redirect the java output to a single log file via 
Debug.setLogFile(log_file). 
  My test framework, however, uses Log4R which direct the log output to 
multiple files as well as the console. 
  Ideally I would like to redirect the logging requests to my logger to do it's 
thing, so that I can get all the output like:
  [LOG] CLICK on L(27,10)@S(0)[0,0 1440x900]
  in the standard log files.

  I kind-a implemented a workaround that does this as follows:
  1. I put in a one-line callback patch in the native_exception_protect() 
method  in the sikulix.rb  file, like this:
  m.bind(self).call(*args)  # previous existing line
  SikuliX4Ruby.post_region_callback(m) if 
SikuliX4Ruby.respond_to?(:post_region_callback)  # line added

  2.  Redirected the java logs to a temp file first, by defining and calling 
the following:
  module SikuliLib
 def self.log_file=(log_file)
  @@log_file = log_file
  Debug.setLogFile(log_file)
  end

  3.  Captured the original logoutput and logged it via myLogger as such:
  module SikuliX4Ruby
def self.post_region_callback(method = nil, obj =nil)
  file = SikuliLib.log_file
  File.readlines(file).each { |line| myLogger.info(line.chomp) } if 
File.size?(file)
  FileUtils.rm file
end
  end

  My workaround does the trick for now, but I'm not happy about the fact that I 
had to copy and patch the sikulix.rb file.
  I would rather not muck with original SikuliX distribution files and use a 
callback that is officially supported, if there is one (The previous question 
thread hinted that there might be one already.)

To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/1350735/+subscriptions

___
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] [Bug 1350735] Re: [request] want options to redirect Sikuli's log messages to my own logging

2014-08-02 Thread Lev
OK. I did not realize the beta release  was the one being updated
nightly.

I tried it with the updated jar. It could not get it to work. 
Below is the code I added (I also tried strings 'info' instead of symbols 
:info):
$log.info $log.methods.include?(:info)
Debug.setLoggerNoPrefix($log)
Debug.setLoggerInfo(:info)
Debug.setLoggerDebug(:debug)
Debug.setLoggerAction(:info)
Debug.setLoggerError(:error)

When I run this, I get the following:

INFO  14-08-02 15:26:22 TrueClass: true
[error] Debug: setLoggerInfo: redirecting to info failed: 
org.jruby.RubyObject.info(java.lang.String)
[log] CLICK on L(27,10)@S(0)[0,0 1440x900]
[log] CLICK on L(306,707)@S(0)[0,0 1440x900]

I also tried the following, but get the same results:
  Debug.setLogger($log)
  Debug.setLoggerAll('info')


On the gem front, something is really strange.  I cleaned up and reinstalled 
the gem repeatedly, but the newly installed gem always has the capital 
'SikuliX', even the the source on the rubygems.org displays 'Sikulix'. 
I manually downloaded and installed the gem with the same result. 
The source and downloaded gem both have version 1.1.01.  
Is it possible that the source code was updated without updating the gem 
version and the updated source not pushed to the repository properly?

-- 
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to Sikuli.
https://bugs.launchpad.net/bugs/1350735

Title:
  [request] want options to redirect Sikuli's log messages to my own
  logging

Status in Sikuli:
  In Progress

Bug description:
  A previous thread that is closest to answering my current question is:
  https://answers.launchpad.net/sikuli/+question/248604
  in which RaiMan suggest the usage of a setSikuliXLogCallback

  I searched the net for setSikuliXLogCallback, but the only hit I got
  was that thread.  Hence this question/plea for more detail.

  I recently started looking into Sikuli using IDE first, then I moved onto 
using standalone Jython, and then finally had the courage to venture into using 
Ruby, which is the primary language of my test framework.
  I was pleasantly surprised how easy and great the interface was. Kudos to 
RaiMan and contributors on this great tool.

  Now, onto my question...
  I can redirect the java output to a single log file via 
Debug.setLogFile(log_file). 
  My test framework, however, uses Log4R which direct the log output to 
multiple files as well as the console. 
  Ideally I would like to redirect the logging requests to my logger to do it's 
thing, so that I can get all the output like:
  [LOG] CLICK on L(27,10)@S(0)[0,0 1440x900]
  in the standard log files.

  I kind-a implemented a workaround that does this as follows:
  1. I put in a one-line callback patch in the native_exception_protect() 
method  in the sikulix.rb  file, like this:
  m.bind(self).call(*args)  # previous existing line
  SikuliX4Ruby.post_region_callback(m) if 
SikuliX4Ruby.respond_to?(:post_region_callback)  # line added

  2.  Redirected the java logs to a temp file first, by defining and calling 
the following:
  module SikuliLib
 def self.log_file=(log_file)
  @@log_file = log_file
  Debug.setLogFile(log_file)
  end

  3.  Captured the original logoutput and logged it via myLogger as such:
  module SikuliX4Ruby
def self.post_region_callback(method = nil, obj =nil)
  file = SikuliLib.log_file
  File.readlines(file).each { |line| myLogger.info(line.chomp) } if 
File.size?(file)
  FileUtils.rm file
end
  end

  My workaround does the trick for now, but I'm not happy about the fact that I 
had to copy and patch the sikulix.rb file.
  I would rather not muck with original SikuliX distribution files and use a 
callback that is officially supported, if there is one (The previous question 
thread hinted that there might be one already.)

To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/1350735/+subscriptions

___
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 #252512]: How to use regions properly

2014-08-02 Thread Smizzy
Question #252512 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/252512

Smizzy posted a new comment:
For those, say i have 4 sets of images and I search for the first image
in each set within a region, is there a way to tell which set the image
came from when it is found?

-- 
You received this question notification because you are a member of
Sikuli Drivers, which 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 #252546]: Script Stopping

2014-08-02 Thread Smizzy
New question #252546 on Sikuli:
https://answers.launchpad.net/sikuli/+question/252546

I have a script similar to this

if exists(image.png)
click(image.png)

The issue is that the image im searching for sometimes disappears inbetween 
those two lines of code. The script cannot click on it fast enough and stops 
running.

How can I either make the mouse react faster or make it not quit the script if 
its unable to click on the image?

-- 
You received this question notification because you are a member of
Sikuli Drivers, which 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 #252546]: Script Stopping

2014-08-02 Thread Mark Weisler
Question #252546 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/252546

Status: Open = Answered

Mark Weisler proposed the following answer:

On Aug 2, 2014, at 5:32 PM, Smizzy wrote:

 New question #252546 on Sikuli:
 https://answers.launchpad.net/sikuli/+question/252546
 
 I have a script similar to this
 
 if exists(image.png)
click(image.png)
 
 The issue is that the image im searching for sometimes disappears inbetween 
 those two lines of code. The script cannot click on it fast enough and stops 
 running.
 
 How can I either make the mouse react faster or make it not quit the script 
 if its unable to click on the image?
 
 -- 
 You received this question notification because you are an answer
 contact for Sikuli.
 

Please try it with this structure...

# --- using exception handling
# every not found in the try block will switch to the except block
try:
find(path-to-image)
pass # it is there
except FindFailed:
pass # we miss it

-- 
Mark Weisler 
PGP Key ID 68E462B6
PGP Key fingerprint  87D5 A77B FC47 3CC3 DFF0  586D 23FF F8B4 68E4 62B6

You received this question notification because you are a member of
Sikuli Drivers, which 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 #252546]: Script Stopping

2014-08-02 Thread Smizzy
Question #252546 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/252546

Status: Answered = Open

Smizzy is still having a problem:
Thanks for the fast reply!

How would i incorporate the click(image.png) into that structure?
And would this replace the exists(image.png) ?

-- 
You received this question notification because you are a member of
Sikuli Drivers, which 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