Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
887c080a
Commit
887c080a
authored
Jan 20, 2006
by
Tim Peters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Whitespace normalization.
parent
bde4ad4f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
Lib/webbrowser.py
Lib/webbrowser.py
+11
-11
No files found.
Lib/webbrowser.py
View file @
887c080a
...
...
@@ -132,9 +132,9 @@ def _iscommand(cmd):
class
BaseBrowser
(
object
):
"""Parent class for all browsers. Do not use directly."""
args
=
[
'%s'
]
def
__init__
(
self
,
name
=
""
):
self
.
name
=
name
self
.
basename
=
name
...
...
@@ -163,7 +163,7 @@ class GenericBrowser(BaseBrowser):
self
.
basename
=
os
.
path
.
basename
(
self
.
name
)
def
open
(
self
,
url
,
new
=
0
,
autoraise
=
1
):
cmdline
=
[
self
.
name
]
+
[
arg
.
replace
(
"%s"
,
url
)
cmdline
=
[
self
.
name
]
+
[
arg
.
replace
(
"%s"
,
url
)
for
arg
in
self
.
args
]
try
:
p
=
subprocess
.
Popen
(
cmdline
,
close_fds
=
True
)
...
...
@@ -209,7 +209,7 @@ class UnixBrowser(BaseBrowser):
if
opt
:
raise_opt
=
[
opt
]
cmdline
=
[
self
.
name
]
+
raise_opt
+
args
if
remote
or
self
.
background
:
inout
=
file
(
os
.
devnull
,
"r+"
)
else
:
...
...
@@ -220,7 +220,7 @@ class UnixBrowser(BaseBrowser):
setsid
=
getattr
(
os
,
'setsid'
,
None
)
if
not
setsid
:
setsid
=
getattr
(
os
,
'setpgrp'
,
None
)
p
=
subprocess
.
Popen
(
cmdline
,
close_fds
=
True
,
stdin
=
inout
,
stdout
=
(
self
.
redirect_stdout
and
inout
or
None
),
stderr
=
inout
,
preexec_fn
=
setsid
)
...
...
@@ -257,7 +257,7 @@ class UnixBrowser(BaseBrowser):
else
:
raise
Error
(
"Bad 'new' parameter to open(); "
+
"expected 0, 1, or 2, got %s"
%
new
)
args
=
[
arg
.
replace
(
"%s"
,
url
).
replace
(
"%action"
,
action
)
for
arg
in
self
.
remote_args
]
success
=
self
.
_invoke
(
args
,
True
,
autoraise
)
...
...
@@ -278,7 +278,7 @@ class Mozilla(UnixBrowser):
remote_action
=
""
remote_action_newwin
=
",new-window"
remote_action_newtab
=
",new-tab"
background
=
True
Netscape
=
Mozilla
...
...
@@ -334,14 +334,14 @@ class Konqueror(BaseBrowser):
action
=
"newTab"
else
:
action
=
"openURL"
devnull
=
file
(
os
.
devnull
,
"r+"
)
# if possible, put browser in separate process group, so
# keyboard interrupts don't affect browser as well as Python
setsid
=
getattr
(
os
,
'setsid'
,
None
)
if
not
setsid
:
setsid
=
getattr
(
os
,
'setpgrp'
,
None
)
try
:
p
=
subprocess
.
Popen
([
"kfmclient"
,
action
,
url
],
close_fds
=
True
,
stdin
=
devnull
,
...
...
@@ -366,7 +366,7 @@ class Konqueror(BaseBrowser):
if
p
.
poll
()
is
None
:
# Should be running now.
return
True
try
:
p
=
subprocess
.
Popen
([
"kfm"
,
"-d"
,
url
],
close_fds
=
True
,
stdin
=
devnull
,
...
...
@@ -550,7 +550,7 @@ if sys.platform == 'darwin':
# hack for local urls
if
not
':'
in
url
:
url
=
'file:'
+
url
# new must be 0 or 1
new
=
int
(
bool
(
new
))
if
self
.
name
==
"default"
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment