← Back to team overview

sikuli-driver team mailing list archive

[Question #176507]: Imported script cannot resolve 'Key' constant

 

New question #176507 on Sikuli:
https://answers.launchpad.net/sikuli/+question/176507

I have an imported script called blur.sikuli.  When I run this on its own, I have no problems.  

there is a line:

    type(Key.F5)

That I use to refresh the page.

If I import this script from another script (main.sikuli) in the same directory, it does not consider Key to be defined.

NameError: global name 'Key' is not defined

Is this a namespace issue?  Seems like it should be safe to do without having to import all of my functions as global

Code:

blur.sikuli
---------------
def blurOperation():
    click("Blur") 
    wait("Blur-1.png")
    click("1319653625110.png")

    assert exists("1319728623722.png")

def blur(self):
    type(Key.F5)
    wait("FIvnuwILHQCA.png")
    blurOperation()

#blur()


main.sikuli
----------------
import blur
blur.blur()

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.