[Sikuli-driver] [Question #658613]: issues when using Python logging module in sikuli

2017-09-24 Thread linmiaoling
New question #658613 on Sikuli:
https://answers.launchpad.net/sikuli/+question/658613

Hi all,
i have issues when using Python logging module in sikuli

run following script in sikuli ide :

import logging

# when run in IDE with reruns to avoid errors use
import logging; reload(logging)

#create a new logging instance
logger = logging.getLogger("MyLogger")

#set the file to log to
logger.addHandler(r"D:\\TestingReports\\file.log")

#set the logging level, DEBUG is the most verbose level
logger.setLevel(logging.DEBUG)

logger.info("We are starting now")

def functionInMyScript():
 logger.debug("entering functionInMyScript()")
 # do something that might fail
 print("run function success!!")
 logger.debug("leaving functionInMyScript()")

try:
functionInMyScript()
logger.debug("Function call succeeded")
except:
logger.error("Function call failed")


but i get error:
[error] script [ log_1 ] stopped with error in line 15
[error] AttributeError ( 'str' object has no attribute 'level' )
[error] --- Traceback --- error source first line: module ( function ) 
statement 1319: __init__ ( callHandlers ) if record.levelno >= hdlr.level:
1280: __init__ ( handle ) self.callHandlers(record)
1270: __init__ ( _log ) self.handle(record)
1151: __init__ ( info ) self._log(INFO, msg, args, **kwargs)
[error] --- Traceback --- end --


What should i do ?
thanks for the help!


-- 
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 #249084]: Startup of commandline sikuli is Slow

2017-09-24 Thread zzzzzz
Question #249084 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/249084

zz posted a new comment:
I would love to have a background runner or something more performant to run 
scripts on demand. I have some short simple scripts that help me automate short 
tasks like navigating to specific menus within apps.
Eg: Opening a specific private message thread within Discord.

Some of these scripts are run from Alfred workflows so I am waiting for
them to run and complete before I can continue using my computer. My
current solution is to have an instance of the Sikuli IDE open with the
scripts open and then have the workflow execute the run command on the
IDE. This is not ideal. :/

It would be great if I could compile the scripts into self-contained
binaries that ran fast or if there was some background runner that
contained the Sikuli runtime so I could execute scripts from command-
line quickly.

-- 
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 #249084]: Startup of commandline sikuli is Slow

2017-09-24 Thread zzzzzz
Question #249084 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/249084

zz posted a new comment:
I would love to have a background runner or something more performant to run 
scripts on demand. I have some short simple scripts that help me automate short 
tasks like navigating to specific menus within apps.
Eg: Opening a specific private message thread within Discord.

Some of these scripts are run from Alfred workflows so I am waiting for
them to run and complete before I can continue using my computer. My
current solution is to have an instance of the Sikuli IDE open with the
scripts open and then have the workflow execute the run command on the
IDE. This is not ideal. :/

It would be great if I could compile the scripts into self-contained
binaries that ran fast or if there was some background runner that
contained the Sikuli runtime so I could execute scripts from command-
line quickly.

-- 
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 #658610]: Not seeing images in popups

2017-09-24 Thread Courtney
New question #658610 on Sikuli:
https://answers.launchpad.net/sikuli/+question/658610

I'm having trouble clicking on images within a popup that appears when an 
object in the application is clicked. Here's my code

def makeMessage():
wait(5)
if exists("img0.PNG"):

click ()
wait(5)
else:
print("Nothing there, whoops")
if exists("img1.PNG",5):
click("button.PNG")
else:
popup("GUI didn't show up, whoops")

What I expect to happen is that after clicking on the first image a new window 
will popup where I'll click a different button. Afterwards a third window pops 
up where text will be entered. I didn't include that part because I can't even 
get past the first part. Should I be using a different format to do this? I 
noticed that even if I just rerun the script with the popup open it will 
actually find the image in the background window. Any help would be greatly 
appreciated. 

-- 
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 #658596]: Lower pattern match within a loop on repeat

2017-09-24 Thread TestMechanic
Question #658596 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/658596

Status: Open => Answered

TestMechanic proposed the following answer:
I am not sure what is the question here.

I guess you are looking for 'similar' command:  Pattern("some-
element.png").similar(0.85)

Have in mind 2 more things:
-- There is a scan rate for images in Sikuli. It is 3 times/second by default
-- The exists command without parameter will look for image for relative short 
time - 3 seconds by default

If you can give more information what is the end goal we may be able to
help you better.

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 #658505]: Installing Sikuki 1.1.1 on Fedora 26

2017-09-24 Thread TestMechanic
Question #658505 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/658505

Status: Open => Solved

TestMechanic confirmed that the question is solved:
Just as follow up

I was able to configure Fedora 25/26 LXDE to install and run Sikuli on
it. I choose LXDE version since it is light weight for testing in VM. I
added my comments to OliPelz instructions:
https://gist.github.com/OliPelz

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