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

Function open

Lib/webbrowser.py:76–96  ·  view source on GitHub ↗

Display url using the default browser. If possible, open url in a location determined by new. - 0: the same browser window (the default). - 1: a new browser window. - 2: a new browser page ("tab"). If possible, autoraise raises the window (the default) or not. If opening th

(url, new=0, autoraise=True)

Source from the content-addressed store, hash-verified

74# instead of "from webbrowser import *".
75
76def open(url, new=0, autoraise=True):
77 """Display url using the default browser.
78
79 If possible, open url in a location determined by new.
80 - 0: the same browser window (the default).
81 - 1: a new browser window.
82 - 2: a new browser page ("tab").
83 If possible, autoraise raises the window (the default) or not.
84
85 If opening the browser succeeds, return True.
86 If there is a problem, return False.
87 """
88 if _tryorder is None:
89 with _lock:
90 if _tryorder is None:
91 register_standard_browsers()
92 for name in _tryorder:
93 browser = get(name)
94 if browser.open(url, new, autoraise):
95 return True
96 return False
97
98
99def open_new(url):

Callers 3

open_newFunction · 0.70
open_new_tabFunction · 0.70
mainFunction · 0.70

Calls 3

getFunction · 0.85
openMethod · 0.45

Tested by

no test coverage detected