def wait_for_exist(self, title, timeOut=<NUM_LIT:5>):
regex = re.compile(title)<EOL>waited = <NUM_LIT:0><EOL>while waited <= timeOut:<EOL><INDENT>retCode, output = self._run_wmctrl(["<STR_LIT>"])<EOL>for line in output.split('<STR_LIT:\n>'):<EOL><INDENT>if regex.match(line[<NUM_LIT>:].split('<STR_LIT:U+0020>', <NUM_LIT:1>)[-<NUM_LIT:1>]):<EOL><INDENT>return True<EOL><DEDENT><DEDENT>if timeOut == <NUM_LIT:0>:<EOL><INDENT>break  <EOL><DEDENT>time.sleep(<NUM_LIT>)<EOL>waited += <NUM_LIT><EOL><DEDENT>return False<EOL>
Wait for window with the given title to be created

Usage: C{window.wait_for_exist(title, timeOut=5)}

If the window is in existence, returns True. Otherwise, returns False if
the window has not been created by the time the timeout has elapsed.

@param title: title to match against (as a regular expression)
@param timeOut: period (seconds) to wait before giving up
@rtype: boolean