(self, url, new=0, autoraise=True)
| 273 | return not p.wait() |
| 274 | |
| 275 | def open(self, url, new=0, autoraise=True): |
| 276 | sys.audit("webbrowser.open", url) |
| 277 | self._check_url(url) |
| 278 | if new == 0: |
| 279 | action = self.remote_action |
| 280 | elif new == 1: |
| 281 | action = self.remote_action_newwin |
| 282 | elif new == 2: |
| 283 | if self.remote_action_newtab is None: |
| 284 | action = self.remote_action_newwin |
| 285 | else: |
| 286 | action = self.remote_action_newtab |
| 287 | else: |
| 288 | raise Error("Bad 'new' parameter to open(); " |
| 289 | f"expected 0, 1, or 2, got {new}") |
| 290 | |
| 291 | args = [arg.replace("%s", url).replace("%action", action) |
| 292 | for arg in self.remote_args] |
| 293 | args = [arg for arg in args if arg] |
| 294 | success = self._invoke(args, True, autoraise, url) |
| 295 | if not success: |
| 296 | # remote invocation failed, try straight way |
| 297 | args = [arg.replace("%s", url) for arg in self.args] |
| 298 | return self._invoke(args, False, False) |
| 299 | else: |
| 300 | return True |
| 301 | |
| 302 | |
| 303 | class Mozilla(UnixBrowser): |
nothing calls this directly
no test coverage detected