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
3166f59d
Kaydet (Commit)
3166f59d
authored
Haz 20, 2003
tarafından
Just van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add initial standalone support for Python.framework
üst
43275216
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
2 deletions
+32
-2
bundlebuilder.py
Lib/plat-mac/bundlebuilder.py
+32
-2
No files found.
Lib/plat-mac/bundlebuilder.py
Dosyayı görüntüle @
3166f59d
...
...
@@ -284,6 +284,7 @@ if %(standalone)s:
os.environ["PYTHONHOME"] = resdir
os.environ["PYTHONEXECUTABLE"] = executable
os.environ["DYLD_LIBRARY_PATH"] = libdir
os.environ["DYLD_FRAMEWORK_PATH"] = libdir
os.execve(executable, sys.argv, os.environ)
"""
...
...
@@ -298,6 +299,18 @@ argvemulator.ArgvCollector().mainloop()
execfile(os.path.join(os.path.split(__file__)[0], "
%(realmainprogram)
s"))
"""
#
# When building a standalone app with Python.framework, we need to copy
# a subset from Python.framework to the bundle. The following list
# specifies exactly what items we'll copy.
#
PYTHONFRAMEWORKGOODIES
=
[
"Python"
,
# the Python core library
"Resources/English.lproj"
,
"Resources/Info.plist"
,
"Resources/version.plist"
,
]
class
AppBuilder
(
BundleBuilder
):
...
...
@@ -331,10 +344,10 @@ class AppBuilder(BundleBuilder):
# If True, build standalone app.
standalone
=
0
# If set, use this for #! lines in stead of sys.executable
python
=
None
# If True, add a real main program that emulates sys.argv before calling
# mainprogram
argv_emulation
=
0
...
...
@@ -392,6 +405,9 @@ class AppBuilder(BundleBuilder):
if
not
hasattr
(
self
.
plist
,
"NSPrincipalClass"
):
self
.
plist
.
NSPrincipalClass
=
"NSApplication"
if
self
.
standalone
and
"Python.framework"
in
sys
.
exec_prefix
:
self
.
addPythonFramework
()
BundleBuilder
.
setup
(
self
)
self
.
plist
.
CFBundleExecutable
=
self
.
name
...
...
@@ -474,6 +490,20 @@ class AppBuilder(BundleBuilder):
if
self
.
missingModules
or
self
.
maybeMissingModules
:
self
.
reportMissing
()
def
addPythonFramework
(
self
):
# If we're building a standalone app with Python.framework,
# include a minimal subset of Python.framework
frameworkpath
=
sys
.
exec_prefix
[:
sys
.
exec_prefix
.
find
(
"Python.framework"
)
+
len
(
"Python.framework"
)]
version
=
sys
.
version
[:
3
]
frameworkpath
=
pathjoin
(
frameworkpath
,
"Versions"
,
version
)
destbase
=
pathjoin
(
"Contents"
,
"Frameworks"
,
"Python.framework"
,
"Versions"
,
version
)
for
item
in
PYTHONFRAMEWORKGOODIES
:
src
=
pathjoin
(
frameworkpath
,
item
)
dst
=
pathjoin
(
destbase
,
item
)
self
.
files
.
append
((
src
,
dst
))
def
addPythonModules
(
self
):
self
.
message
(
"Adding Python modules"
,
1
)
...
...
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