Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
4ef1c7e7
Kaydet (Commit)
4ef1c7e7
authored
May 02, 2010
tarafından
Ronald Oussoren
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
For for issue #7192: with this patch webbrowser.get("firefox")
works on OSX
üst
328284ad
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
1 deletion
+30
-1
webbrowser.py
Lib/webbrowser.py
+27
-1
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/webbrowser.py
Dosyayı görüntüle @
4ef1c7e7
...
@@ -599,9 +599,35 @@ if sys.platform == 'darwin':
...
@@ -599,9 +599,35 @@ if sys.platform == 'darwin':
rc
=
osapipe
.
close
()
rc
=
osapipe
.
close
()
return
not
rc
return
not
rc
class
MacOSXOSAScript
(
BaseBrowser
):
def
__init__
(
self
,
name
):
self
.
_name
=
name
def
open
(
self
,
url
,
new
=
0
,
autoraise
=
True
):
if
self
.
_name
==
'default'
:
script
=
'open location "
%
s"'
%
url
.
replace
(
'"'
,
'
%22
'
)
# opens in default browser
else
:
script
=
'''
tell application "
%
s"
activate
open location "
%
s"
end
'''
%
(
self
.
_name
,
url
.
replace
(
'"'
,
'
%22
'
))
osapipe
=
os
.
popen
(
"osascript"
,
"w"
)
if
osapipe
is
None
:
return
False
osapipe
.
write
(
script
)
rc
=
osapipe
.
close
()
return
not
rc
# Don't clear _tryorder or _browsers since OS X can use above Unix support
# Don't clear _tryorder or _browsers since OS X can use above Unix support
# (but we prefer using the OS X specific stuff)
# (but we prefer using the OS X specific stuff)
register
(
"MacOSX"
,
None
,
MacOSX
(
'default'
),
-
1
)
register
(
"MacOSX"
,
None
,
MacOSXOSAScript
(
'default'
),
-
1
)
register
(
"safari"
,
None
,
MacOSXOSAScript
(
'safari'
),
-
1
)
register
(
"firefox"
,
None
,
MacOSXOSAScript
(
'firefox'
),
-
1
)
#
#
...
...
Misc/NEWS
Dosyayı görüntüle @
4ef1c7e7
...
@@ -31,6 +31,9 @@ Core and Builtins
...
@@ -31,6 +31,9 @@ Core and Builtins
Library
Library
-------
-------
- Issue #7192: webbrowser.get("firefox") now wors on Mac OS X, as does
webbrowser.get("safari").
- Issue #8577: distutils.sysconfig.get_python_inc() now makes a difference
- Issue #8577: distutils.sysconfig.get_python_inc() now makes a difference
between the build dir and the source dir when looking for "python.h" or
between the build dir and the source dir when looking for "python.h" or
"Include".
"Include".
...
...
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