tools/mac/power/driver.py
def FindBrowserProcess(self, browser):
    """Looks for the process associated with |browser|.

    Args:
      browser: A string of the browser name

    Returns:
      A psutil.process representation of the browser process.

    Raises:
      SystemExit: When no process is found for the browser.
    """

    process_name = utils.get_browser_property(browser, 'process_name')
    processes = filter(lambda p: p.name() == process_name,
                       psutil.process_iter())
    browser_process = None

    for process in processes:
      if not browser_process:
        browser_process = process
      else:
        logging.error("Too many copies of the browser running, this is wrong")
        sys.exit(-1)

    return browser_process
Looks for the process associated with |browser|.

    Args:
      browser: A string of the browser name

    Returns:
      A psutil.process representation of the browser process.

    Raises:
      SystemExit: When no process is found for the browser.
    
Looks for the process associated with |browser|.
Looks for the process associated with |browser| .
def FindBrowserProcess(self, browser):
    process_name = utils.get_browser_property(browser, 'process_name')
    processes = filter(lambda p: p.name() == process_name,
                       psutil.process_iter())
    browser_process = None
    for process in processes:
      if not browser_process:
        browser_process = process
      else:
        logging.error("Too many copies of the browser running, this is wrong")
        sys.exit(-1)
    return browser_process
def FindBrowserProcess ( self , browser ) : process_name = utils . get_browser_property ( browser , 'process_name' ) processes = filter ( lambda p : p . name ( ) == process_name , psutil . process_iter ( ) ) browser_process = None for process in processes : if not browser_process : browser_process = process else : logging . error ( "Too many copies of the browser running, this is wrong" ) sys . exit ( - 1 ) return browser_process
Looks for the process associated with |browser|.
Looks for the process associated with |browser| .
"""Looks for the process associated with |browser|.

    Args:
      browser: A string of the browser name

    Returns:
      A psutil.process representation of the browser process.

    Raises:
      SystemExit: When no process is found for the browser.
    """
A psutil.process representation of the browser process.
A psutil . process representation of the browser process .
When no process is found for the browser.
When no process is found for the browser .
SystemExit
self
browser
A string of the browser name
A string of the browser name