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
192bd966
Kaydet (Commit)
192bd966
authored
Şub 28, 2004
tarafından
Jack Jansen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
getDefaultDatabase() should be a toplevel function, not a method of the
preferences object.
üst
afd63b9c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
48 deletions
+46
-48
pimp.py
Lib/plat-mac/pimp.py
+46
-48
No files found.
Lib/plat-mac/pimp.py
Dosyayı görüntüle @
192bd966
...
@@ -46,6 +46,51 @@ DEFAULT_BUILDDIR='/tmp'
...
@@ -46,6 +46,51 @@ DEFAULT_BUILDDIR='/tmp'
DEFAULT_INSTALLDIR
=
distutils
.
sysconfig
.
get_python_lib
()
DEFAULT_INSTALLDIR
=
distutils
.
sysconfig
.
get_python_lib
()
DEFAULT_PIMPDATABASE_FMT
=
"http://www.python.org/packman/version-
%
s/
%
s-
%
s-
%
s-
%
s-
%
s.plist"
DEFAULT_PIMPDATABASE_FMT
=
"http://www.python.org/packman/version-
%
s/
%
s-
%
s-
%
s-
%
s-
%
s.plist"
def
getDefaultDatabase
(
experimental
=
False
):
if
experimental
:
status
=
"exp"
else
:
status
=
"prod"
major
,
minor
,
micro
,
state
,
extra
=
sys
.
version_info
pyvers
=
'
%
d.
%
d'
%
(
major
,
minor
)
if
state
!=
'final'
:
pyvers
=
pyvers
+
'
%
s
%
d'
%
(
state
,
extra
)
longplatform
=
distutils
.
util
.
get_platform
()
osname
,
release
,
machine
=
longplatform
.
split
(
'-'
)
# For some platforms we may want to differentiate between
# installation types
if
osname
==
'darwin'
:
if
sys
.
prefix
.
startswith
(
'/System/Library/Frameworks/Python.framework'
):
osname
=
'darwin_apple'
elif
sys
.
prefix
.
startswith
(
'/Library/Frameworks/Python.framework'
):
osname
=
'darwin_macpython'
# Otherwise we don't know...
# Now we try various URLs by playing with the release string.
# We remove numbers off the end until we find a match.
rel
=
release
while
True
:
url
=
DEFAULT_PIMPDATABASE_FMT
%
(
PIMP_VERSION
,
status
,
pyvers
,
osname
,
rel
,
machine
)
try
:
urllib2
.
urlopen
(
url
)
except
urllib2
.
HTTPError
,
arg
:
pass
else
:
break
if
not
rel
:
# We're out of version numbers to try. Use the
# full release number, this will give a reasonable
# error message later
url
=
DEFAULT_PIMPDATABASE_FMT
%
(
PIMP_VERSION
,
status
,
pyvers
,
osname
,
release
,
machine
)
break
idx
=
rel
.
rfind
(
'.'
)
if
idx
<
0
:
rel
=
''
else
:
rel
=
rel
[:
idx
]
return
url
def
_cmd
(
output
,
dir
,
*
cmditems
):
def
_cmd
(
output
,
dir
,
*
cmditems
):
"""Internal routine to run a shell command in a given directory."""
"""Internal routine to run a shell command in a given directory."""
...
@@ -163,7 +208,7 @@ class PimpPreferences:
...
@@ -163,7 +208,7 @@ class PimpPreferences:
if
not
buildDir
:
if
not
buildDir
:
buildDir
=
DEFAULT_BUILDDIR
buildDir
=
DEFAULT_BUILDDIR
if
not
pimpDatabase
:
if
not
pimpDatabase
:
pimpDatabase
=
self
.
getDefaultDatabase
()
pimpDatabase
=
getDefaultDatabase
()
self
.
setInstallDir
(
installDir
)
self
.
setInstallDir
(
installDir
)
self
.
flavorOrder
=
flavorOrder
self
.
flavorOrder
=
flavorOrder
self
.
downloadDir
=
downloadDir
self
.
downloadDir
=
downloadDir
...
@@ -185,53 +230,6 @@ class PimpPreferences:
...
@@ -185,53 +230,6 @@ class PimpPreferences:
def
isUserInstall
(
self
):
def
isUserInstall
(
self
):
return
self
.
installDir
!=
DEFAULT_INSTALLDIR
return
self
.
installDir
!=
DEFAULT_INSTALLDIR
def
getDefaultDatabase
(
self
,
experimental
=
False
):
if
experimental
:
status
=
"exp"
else
:
status
=
"prod"
major
,
minor
,
micro
,
state
,
extra
=
sys
.
version_info
pyvers
=
'
%
d.
%
d'
%
(
major
,
minor
)
if
state
!=
'final'
:
pyvers
=
pyvers
+
'
%
s
%
d'
%
(
state
,
extra
)
longplatform
=
distutils
.
util
.
get_platform
()
osname
,
release
,
machine
=
longplatform
.
split
(
'-'
)
# For some platforms we may want to differentiate between
# installation types
if
osname
==
'darwin'
:
if
sys
.
prefix
.
startswith
(
'/System/Library/Frameworks/Python.framework'
):
osname
=
'darwin_apple'
elif
sys
.
prefix
.
startswith
(
'/Library/Frameworks/Python.framework'
):
osname
=
'darwin_macpython'
# Otherwise we don't know...
# Now we try various URLs by playing with the release string.
# We remove numbers off the end until we find a match.
rel
=
release
while
True
:
url
=
DEFAULT_PIMPDATABASE_FMT
%
(
PIMP_VERSION
,
status
,
pyvers
,
osname
,
rel
,
machine
)
try
:
urllib2
.
urlopen
(
url
)
except
urllib2
.
HTTPError
,
arg
:
print
'getDefaultDatabase: cannot open'
,
url
print
'error'
,
arg
pass
else
:
break
if
not
rel
:
# We're out of version numbers to try. Use the
# full release number, this will give a reasonable
# error message later
url
=
DEFAULT_PIMPDATABASE_FMT
%
(
PIMP_VERSION
,
status
,
pyvers
,
osname
,
release
,
machine
)
break
idx
=
rel
.
rfind
(
'.'
)
if
idx
<
0
:
rel
=
''
else
:
rel
=
rel
[:
idx
]
return
url
def
check
(
self
):
def
check
(
self
):
"""Check that the preferences make sense: directories exist and are
"""Check that the preferences make sense: directories exist and are
...
...
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