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

Method open

Lib/webbrowser.py:597–616  ·  view source on GitHub ↗
(self, url, new=0, autoraise=True)

Source from the content-addressed store, hash-verified

595 super().__init__(name)
596
597 def open(self, url, new=0, autoraise=True):
598 sys.audit("webbrowser.open", url)
599 url = url.replace('"', '%22')
600 if self.name == 'default':
601 script = f'open location "{url}"' # opens in default browser
602 else:
603 script = f'''
604 tell application "{self.name}"
605 activate
606 open location "{url}"
607 end
608 '''
609
610 osapipe = os.popen("osascript", "w")
611 if osapipe is None:
612 return False
613
614 osapipe.write(script)
615 rc = osapipe.close()
616 return not rc
617
618#
619# Platform support for iOS

Callers

nothing calls this directly

Calls 3

replaceMethod · 0.45
writeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected