| 256 | return not p.wait() |
| 257 | |
| 258 | def open(self, url, new=0, autoraise=True): |
| 259 | sys.audit("webbrowser.open", url) |
| 260 | if new == 0: |
| 261 | action = self.remote_action |
| 262 | elif new == 1: |
| 263 | action = self.remote_action_newwin |
| 264 | elif new == 2: |
| 265 | if self.remote_action_newtab is None: |
| 266 | action = self.remote_action_newwin |
| 267 | else: |
| 268 | action = self.remote_action_newtab |
| 269 | else: |
| 270 | raise Error("Bad 'new' parameter to open(); " + |
| 271 | "expected 0, 1, or 2, got %s" % new) |
| 272 | |
| 273 | args = [arg.replace("%s", url).replace("%action", action) |
| 274 | for arg in self.remote_args] |
| 275 | args = [arg for arg in args if arg] |
| 276 | success = self._invoke(args, True, autoraise, url) |
| 277 | if not success: |
| 278 | # remote invocation failed, try straight way |
| 279 | args = [arg.replace("%s", url) for arg in self.args] |
| 280 | return self._invoke(args, False, False) |
| 281 | else: |
| 282 | return True |
| 283 | |
| 284 | |
| 285 | class Mozilla(UnixBrowser): |