MCPcopy Index your code
hub / github.com/RustPython/RustPython / get

Function get

Lib/webbrowser.py:41–69  ·  view source on GitHub ↗

Return a browser launcher instance appropriate for the environment.

(using=None)

Source from the content-addressed store, hash-verified

39
40
41def get(using=None):
42 """Return a browser launcher instance appropriate for the environment."""
43 if _tryorder is None:
44 with _lock:
45 if _tryorder is None:
46 register_standard_browsers()
47 if using is not None:
48 alternatives = [using]
49 else:
50 alternatives = _tryorder
51 for browser in alternatives:
52 if '%s' in browser:
53 # User gave us a command line, split it into name and args
54 browser = shlex.split(browser)
55 if browser[-1] == '&':
56 return BackgroundBrowser(browser[:-1])
57 else:
58 return GenericBrowser(browser)
59 else:
60 # User gave us a browser name or path.
61 try:
62 command = _browsers[browser.lower()]
63 except KeyError:
64 command = _synthesize(browser)
65 if command[1] is not None:
66 return command[1]
67 elif command[0] is not None:
68 return command[0]()
69 raise Error("could not locate runnable browser")
70
71
72# Please note: the following definition hides a builtin function.

Callers 15

__get__Method · 0.85
openFunction · 0.85
_descriptor_getFunction · 0.85
test_asyncMethod · 0.85
__enter__Method · 0.85
__exit__Method · 0.85
workerFunction · 0.85
_handle_resultsMethod · 0.85
panic_hookFunction · 0.85
run_pyFunction · 0.85
object_entriesFunction · 0.85
rand_pseudo_bytesFunction · 0.85

Calls 7

BackgroundBrowserClass · 0.85
GenericBrowserClass · 0.85
_synthesizeFunction · 0.85
ErrorClass · 0.70
splitMethod · 0.45
lowerMethod · 0.45

Tested by 1

test_asyncMethod · 0.68