parameters: (hwnd, rect=None, timeout=20, tick=0.1, done=10)
return_statement: return -1
docstring: Wait for a browser's "throbber" (loading animation) to complete.
  
    Args:
      hwnd: window containing the throbber
      rect: rectangle of the throbber, in client coords. If None, whole window
      timeout: if the throbber is still throbbing after this long, give up
      tick: how often to check the throbber
      done: how long the throbber must be unmoving to be considered done
  
    Returns:
      Number of seconds waited, -1 if timed out
docstring_summary: Wait for a browser's "throbber" (loading animation) to complete.
docstring_tokens: Wait for a browser s throbber ( loading animation ) to complete .
function: def WaitForThrobber(hwnd, rect=None, timeout=20, tick=0.1, done=10):
    """Wait for a browser's "throbber" (loading animation) to complete.
  
    Args:
      hwnd: window containing the throbber
      rect: rectangle of the throbber, in client coords. If None, whole window
      timeout: if the throbber is still throbbing after this long, give up
      tick: how often to check the throbber
      done: how long the throbber must be unmoving to be considered done
  
    Returns:
      Number of seconds waited, -1 if timed out
    """
    if not rect: rect = win32gui.GetClientRect(hwnd)
  
    # last_throbber will hold the results of the preceding scrape;
    # we'll compare it against the current scrape to see if we're throbbing
    last_throbber = ScrapeWindow(hwnd, rect)
    start_clock = time.clock()
    timeout_clock = start_clock + timeout
    last_changed_clock = start_clock;
  
    while time.clock() < timeout_clock:
      time.sleep(tick)
  
      current_throbber = ScrapeWindow(hwnd, rect)
      if current_throbber.tostring() != last_throbber.tostring():
        last_throbber = current_throbber
        last_changed_clock = time.clock()
      else:
        if time.clock() - last_changed_clock > done:
          return last_changed_clock - start_clock
  
    return -1
function_tokens: def WaitForThrobber ( hwnd , rect = None , timeout = 20 , tick = 0.1 , done = 10 ) : if not rect : rect = win32gui . GetClientRect ( hwnd ) # last_throbber will hold the results of the preceding scrape; # we'll compare it against the current scrape to see if we're throbbing last_throbber = ScrapeWindow ( hwnd , rect ) start_clock = time . clock ( ) timeout_clock = start_clock + timeout last_changed_clock = start_clock while time . clock ( ) < timeout_clock : time . sleep ( tick ) current_throbber = ScrapeWindow ( hwnd , rect ) if current_throbber . tostring ( ) != last_throbber . tostring ( ) : last_throbber = current_throbber last_changed_clock = time . clock ( ) else : if time . clock ( ) - last_changed_clock > done : return last_changed_clock - start_clock return - 1