Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(5)

Side by Side Diff: Lib/webbrowser.py

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Lib/urllib/response.py ('k') | Lib/xml/dom/pulldom.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #! /usr/bin/env python3 1 #! /usr/bin/env python3
2 """Interfaces for launching and remotely controlling Web browsers.""" 2 """Interfaces for launching and remotely controlling Web browsers."""
3 # Maintained by Georg Brandl. 3 # Maintained by Georg Brandl.
4 4
5 import io 5 import io
6 import os 6 import os
7 import shlex 7 import shlex
8 import sys 8 import sys
9 import stat 9 import stat
10 import subprocess 10 import subprocess
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 225
226 if remote or self.background: 226 if remote or self.background:
227 inout = io.open(os.devnull, "r+") 227 inout = io.open(os.devnull, "r+")
228 else: 228 else:
229 # for TTY browsers, we need stdin/out 229 # for TTY browsers, we need stdin/out
230 inout = None 230 inout = None
231 p = subprocess.Popen(cmdline, close_fds=True, stdin=inout, 231 p = subprocess.Popen(cmdline, close_fds=True, stdin=inout,
232 stdout=(self.redirect_stdout and inout or None), 232 stdout=(self.redirect_stdout and inout or None),
233 stderr=inout, start_new_session=True) 233 stderr=inout, start_new_session=True)
234 if remote: 234 if remote:
235 # wait five seconds. If the subprocess is not finished, the 235 # wait five secons. If the subprocess is not finished, the
236 # remote invocation has (hopefully) started a new instance. 236 # remote invocation has (hopefully) started a new instance.
237 time.sleep(1) 237 time.sleep(1)
238 rc = p.poll() 238 rc = p.poll()
239 if rc is None: 239 if rc is None:
240 time.sleep(4) 240 time.sleep(4)
241 rc = p.poll() 241 rc = p.poll()
242 if rc is None: 242 if rc is None:
243 return True 243 return True
244 # if remote call failed, open() will try direct invocation 244 # if remote call failed, open() will try direct invocation
245 return not rc 245 return not rc
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 print(usage, file=sys.stderr) 659 print(usage, file=sys.stderr)
660 sys.exit(1) 660 sys.exit(1)
661 661
662 url = args[0] 662 url = args[0]
663 open(url, new_win) 663 open(url, new_win)
664 664
665 print("\a") 665 print("\a")
666 666
667 if __name__ == "__main__": 667 if __name__ == "__main__":
668 main() 668 main()
OLDNEW
« no previous file with comments | « Lib/urllib/response.py ('k') | Lib/xml/dom/pulldom.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+