Re: [Sikuli-driver] [Question #141103]: How to get string of PS into FindFailed exception clause

2011-01-12 Thread Vivek Ayer
Question #141103 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/141103

Status: Answered = Open

Vivek Ayer is still having a problem:
Actually, since I just want the debug output of FindFailed, which
includes the path name of the image it couldn't find, I can just do
this:

try:
   click(PS)
except FindFailed, debugging:
   print debugging

The debugging output is stored in 'debugging', which I can then play
with.

Thanks for the tip!
Vivek

On Tue, Jan 11, 2011 at 11:54 PM, RaiMan
question141...@answers.launchpad.net wrote:
 Your question #141103 on Sikuli changed:
 https://answers.launchpad.net/sikuli/+question/141103

    Status: Open = Answered

 RaiMan proposed the following answer:
 Not a feature in the moment, you should post a [feature request] bug:
 match should know it's pattern.

 Since I hated FindFailed from beginning, I requested exists() ... and
 got it ;-)

 Solution with exists (works with try: except: as well ;-)

 img = Pattern or string
 if exists(img): click(getLastMatch())
 else: print FindFailed:, img; exit(1)

 with exists() you might even go on in your script and take corrective
 actions in case of FindFailed.

 Tip:
 for such simple constructs like

 try:
   click(PS)
 except FindFailed:
   ?? how to get str(PS) here??

 I use to make it more readable:

 try: click(PS)
 except: print error; exit(1)

 --
 If this answers your question, please go to the following page to let us
 know that it is solved:
 https://answers.launchpad.net/sikuli/+question/141103/+confirm?answer_id=0

 If you still need help, you can reply to this email or go to the
 following page to enter your feedback:
 https://answers.launchpad.net/sikuli/+question/141103

 You received this question notification because you are a direct
 subscriber of the question.


-- 
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 #141103]: How to get string of PS into FindFailed exception clause

2011-01-12 Thread Vivek Ayer
Question #141103 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/141103

Status: Open = Solved

Vivek Ayer confirmed that the question is solved:
Thanks RaiMan, that solved my question.

-- 
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