(using=None)
Return a browser launcher instance appropriate for the environment.
Return a browser launcher instance appropriate for the environment.
Return a browser launcher instance appropriate for the environment .
def get(using=None):
    """Return a browser launcher instance appropriate for the environment."""
    if _tryorder is None:
        with _lock:
            if _tryorder is None:
                register_standard_browsers()
    if using is not None:
        alternatives = [using]
    else:
        alternatives = _tryorder
    for browser in alternatives:
        if '%s' in browser:
            # User gave us a command line, split it into name and args
            browser = shlex.split(browser)
            if browser[-1] == '&':
                return BackgroundBrowser(browser[:-1])
            else:
                return GenericBrowser(browser)
        else:
            # User gave us a browser name or path.
            try:
                command = _browsers[browser.lower()]
            except KeyError:
                command = _synthesize(browser)
            if command[1] is not None:
                return command[1]
            elif command[0] is not None:
                return command[0]()
    raise Error("could not locate runnable browser")
def get ( using = None ) : if _tryorder is None : with _lock : if _tryorder is None : register_standard_browsers ( ) if using is not None : alternatives = [ using ] else : alternatives = _tryorder for browser in alternatives : if '%s' in browser : # User gave us a command line, split it into name and args browser = shlex . split ( browser ) if browser [ - 1 ] == '&' : return BackgroundBrowser ( browser [ : - 1 ] ) else : return GenericBrowser ( browser ) else : # User gave us a browser name or path. try : command = _browsers [ browser . lower ( ) ] except KeyError : command = _synthesize ( browser ) if command [ 1 ] is not None : return command [ 1 ] elif command [ 0 ] is not None : return command [ 0 ] ( ) raise Error ( "could not locate runnable browser" )