chrome/updater/test/service/win/ui.py
def WaitForWindow(title, class_name, timeout=30):
  """Waits for window with given title and class to appear.

  Args:
    title: Windows title to search.
    class_name: Class name of the window to search.
    timeout: How long should wait before give up.

  Returns:
    A tuple of (HWND, title) of the found window, or (None, None) otherwise.
  """
  logging.info('ui.WaitForWindow("%s", "%s") for %s seconds', title,
               class_name, timeout)
  hwnd = None
  start = time.perf_counter()
  stop = start + int(timeout)

  while time.perf_counter() < stop:
    hwnd = FindWindow(title, class_name)
    if hwnd:
      elapsed = time.perf_counter() - start
      logging.info('Window ["%s"] found in %f seconds', title, elapsed)
      return (hwnd, title)
    logging.info('Window with title [%s] has not appeared yet.', title)
    time.sleep(0.5)

  logging.warning('WARNING: (%s,"%s") not found within %f seconds', title,
                  class_name, timeout)
  return (None, None)
Waits for window with given title and class to appear.

  Args:
    title: Windows title to search.
    class_name: Class name of the window to search.
    timeout: How long should wait before give up.

  Returns:
    A tuple of (HWND, title) of the found window, or (None, None) otherwise.
  
Waits for window with given title and class to appear.
Waits for window with given title and class to appear .
def WaitForWindow(title, class_name, timeout=30):
  logging.info('ui.WaitForWindow("%s", "%s") for %s seconds', title,
               class_name, timeout)
  hwnd = None
  start = time.perf_counter()
  stop = start + int(timeout)
  while time.perf_counter() < stop:
    hwnd = FindWindow(title, class_name)
    if hwnd:
      elapsed = time.perf_counter() - start
      logging.info('Window ["%s"] found in %f seconds', title, elapsed)
      return (hwnd, title)
    logging.info('Window with title [%s] has not appeared yet.', title)
    time.sleep(0.5)
  logging.warning('WARNING: (%s,"%s") not found within %f seconds', title,
                  class_name, timeout)
  return (None, None)
def WaitForWindow ( title , class_name , timeout = 30 ) : logging . info ( 'ui.WaitForWindow("%s", "%s") for %s seconds' , title , class_name , timeout ) hwnd = None start = time . perf_counter ( ) stop = start + int ( timeout ) while time . perf_counter ( ) < stop : hwnd = FindWindow ( title , class_name ) if hwnd : elapsed = time . perf_counter ( ) - start logging . info ( 'Window ["%s"] found in %f seconds' , title , elapsed ) return ( hwnd , title ) logging . info ( 'Window with title [%s] has not appeared yet.' , title ) time . sleep ( 0.5 ) logging . warning ( 'WARNING: (%s,"%s") not found within %f seconds' , title , class_name , timeout ) return ( None , None )
Waits for window with given title and class to appear.
Waits for window with given title and class to appear .
"""Waits for window with given title and class to appear.

  Args:
    title: Windows title to search.
    class_name: Class name of the window to search.
    timeout: How long should wait before give up.

  Returns:
    A tuple of (HWND, title) of the found window, or (None, None) otherwise.
  """
A tuple of (HWND, title) of the found window, or (None, None) otherwise.
A tuple of ( HWND title ) of the found window or ( None None ) otherwise .
title
Windows title to search.
Windows title to search .
class_name
Class name of the window to search.
Class name of the window to search .
timeout
None