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