def wait(target, timeout=2):
    try:
        return sikuli_method('wait', target, float(timeout))
    except FindFailed, e:
        log.html_img("wait: Find failed", "images/" + getFilename(target))
        sik_scrn = SikuliScreen()
        log.screenshot(msg="Screen",
                       region=(sik_scrn.getX(), sik_scrn.getY(),
                               sik_scrn.getW(), sik_scrn.getH()))
        raise e
def click(target, modifiers=0):
    try:
        return sikuli_method('click', target, modifiers)
    except FindFailed, e:
        log.html_img("click: Find failed", "images/" + getFilename(target))
        sik_scrn = SikuliScreen()
        log.screenshot(msg="Screen",
                       region=(sik_scrn.getX(), sik_scrn.getY(),
                               sik_scrn.getW(), sik_scrn.getH()))
        raise e
def verify(target, timeout=0):
    addFoundImage(getFilename(target))
    result = sikuli_method('exists', target, float(timeout))
    if not result:
        log.html_img("verify: Find failed", "images/" + getFilename(target))
        sik_scrn = SikuliScreen()
        log.screenshot(msg="Source Image",
                       region=(sik_scrn.getX(), sik_scrn.getY(),
                               sik_scrn.getW(), sik_scrn.getH()))
        raise VerifyException('Find failed for image ' + getFilename(target))
    return result
def wait(target, timeout=2):
    try:
        return sikuli_method('wait', target, float(timeout))
    except FindFailed, e:
        log.html_img("wait: Find failed", "images/"+getFilename(target))
        sik_scrn = SikuliScreen()
        log.screenshot(msg="Screen", region=(sik_scrn.getX(), sik_scrn.getY(), sik_scrn.getW(), sik_scrn.getH()))
        raise e
def rightClick(target, modifiers=0):
    try:
        return sikuli_method('rightClick', target, modifiers)
    except FindFailed, e:
        log.html_img("rightClick: Find failed", "images/"+getFilename(target))
        sik_scrn = SikuliScreen()
        log.screenshot(msg="Screen", region=(sik_scrn.getX(), sik_scrn.getY(), sik_scrn.getW(), sik_scrn.getH()))
        raise e
def verify(target, timeout=0):
    addFoundImage(getFilename(target))
    result = sikuli_method('exists', target, float(timeout))
    if not result:
        log.html_img("verify: Find failed", "images/"+getFilename(target))
        sik_scrn = SikuliScreen()
        log.screenshot(msg="Source Image", region=(sik_scrn.getX(), sik_scrn.getY(), sik_scrn.getW(), sik_scrn.getH()))
        raise VerifyException('Find failed for image ' + getFilename(target))
    return result