Class for all browsers which are to be started in the background.
| 185 | |
| 186 | |
| 187 | class BackgroundBrowser(GenericBrowser): |
| 188 | """Class for all browsers which are to be started in the |
| 189 | background.""" |
| 190 | |
| 191 | def open(self, url, new=0, autoraise=True): |
| 192 | cmdline = [self.name] + [arg.replace("%s", url) |
| 193 | for arg in self.args] |
| 194 | sys.audit("webbrowser.open", url) |
| 195 | try: |
| 196 | if sys.platform[:3] == 'win': |
| 197 | p = subprocess.Popen(cmdline) |
| 198 | else: |
| 199 | p = subprocess.Popen(cmdline, close_fds=True, |
| 200 | start_new_session=True) |
| 201 | return (p.poll() is None) |
| 202 | except OSError: |
| 203 | return False |
| 204 | |
| 205 | |
| 206 | class UnixBrowser(BaseBrowser): |
no outgoing calls
no test coverage detected