All pastes #353318 Raw Edit

lavi

public python v1 · immutable
·published 2007-02-13 08:46 UTC
rendered paste body
def waittillguiexist (windowName, guiTimeOut = ''):	""" If the given window name exist, this function returns 1. If window doesnot exist, 	then this function returns 0. Difference between guiexist and waitguiexist is, 	waitguiexist waits for maximum 30 seconds. Still the window doesn't appear, 	then 0 is returned. We can set the environment variable 'GUI_TIMEOUT' to change 	the default waiting time.	INPUT: waittillguiexist ('<window name>')	OUTPUT: returns 1 on success and 0 on no existing window """	try:		_requestId  = str (random.randint (0, sys.maxint))		_message = generatexml (command.WAITTILLGUIEXIST, _requestId, windowName, str (guiTimeOut))		_responseStatus, _responseData = getresponse (_requestId)		if _responseStatus [0] != 0:			return 0		return 1	except LdtpExecutionError, msg:		raise LdtpExecutionError (str (msg))