A strange behaviour?

Asked by Garima Kumar

Hello team,

today i have observed a strange behaviour of sikuli.
few days back i have written some code, that time it was working fine for me.
today when i ran that code it started giving me error saying image not found.

scnario is like this:

i am refering to a folder to read the images.
this folder containd 3 images, out of these my code is able to identify 1.
rest of 2 it says not found on disk.
i have copy pasted the code again for those 2 images.
and the name get replaces with the actual image.
i tried to run again but no result.

Can you please let me know what the resion is?

i have cross varified that the images are available at the refered location.

Thanks and regards
Garima

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

What version of Sikuli.

pls. paste the exact code here (only the snippet using the images) and the exact filenames including paths.

Revision history for this message
Garima Kumar (garima-bit-mca) said :
#2

Hello RaiMan,
Sorry for late responce for the information.
i have been using Sikuli 1.0.1 version.
and here is the code i have been using

"
import org.sikuli.script.FindFailed as FindFailed
import os
import sys
import traceback
import logFileGeneration
moduleName = "Module Name :" + str(sys.argv[0]) + "\n"
#Settings.Highlight = True
setBundlePath("E:\Garima\ImageRepository")
def step2():
    logFileGeneration.LogFile(0, "Step2 started.")
    try:
        if exists("patients\symbiaBoneTomoCT.png"):
            print "Patient Symbia Bone Tomo CT is available."
        wait(1)
        if exists("workflows\symbiaWFT.png"):
            print "WorkFlow Template SymbiaWFT is available in Server."
        click("ListSeriesButton.png")
        wait(5)
        if exists("patients\boneSPECT_CTSeries.png"):
            print "Bone SPECT-CT Series is available."
        if exists("patients\ac_CTBoneSeries.png"):
            print "AC CT SPECT-CT Series is available."
    except:
        print "failed"
        excType = sys.exc_info()[:1]
        var = traceback.format_exc()
        methodName = "Method Name :step2 \n"
        message = str(moduleName) + str(methodName) + str(excType) + "\n" + str(var)
        print message
        logFileGeneration.LogFile(2, message)

step2()
"
Regards
Garima

Revision history for this message
Best RaiMan (raimund-hocke) said :
#3

I admit this strange behavior (not consistent, but in special, not yet identified situations).

I made it a bug report.

as a workaround you might try
  if exists("patients\" + "boneSPECT_CTSeries.png"):

instead.

.. and hide the subdirs behind variables:
patients = "patients/"

  if exists(patients + "boneSPECT_CTSeries.png"):

Revision history for this message
Garima Kumar (garima-bit-mca) said :
#4

thanks RaiMan :-)