← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #154347]: Wait for this OR that

 

Question #154347 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/154347

RaiMan posted a new comment:
while preparing a FAQ for this I found that this looks more elegant:

	if isinstance(more[0], Region): 
		# a Region is given to restrict the search
 		reg = more[0]
		more = more[1:]
	# check how the list of images is given
 	if isinstance(more[0], tuple):
		images = more[0]
	elif isinstance(more[0], list): 
		images = more[0]
	else: 
		images = more

it should replace this

 if more[0].__class__.__name__ == "Region":
  # a Region is given to restrict the search
  reg = more[0]
  more = more[1:]
 classM0 = more[0].__class__.__name__
 # check how the list of images is given
 if classM0 == "tuple":
  images = more[0]
 elif classM0 == "list":
  images = more[0]
 else:
  images = more

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