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
cc94764c
Kaydet (Commit)
cc94764c
authored
Şub 02, 2003
tarafından
Jack Jansen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Getting rid of macfs usage and almost all FSSpecs. Untested on MacOS9.
üst
52377e05
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
18 deletions
+22
-18
buildtools.py
Lib/plat-mac/buildtools.py
+22
-18
No files found.
Lib/plat-mac/buildtools.py
Dosyayı görüntüle @
cc94764c
...
...
@@ -5,9 +5,9 @@ import os
import
string
import
imp
import
marshal
import
macfs
from
Carbon
import
Res
import
MACFS
import
Carbon.Files
import
Carbon.File
import
MacOS
import
macostools
import
macresource
...
...
@@ -38,6 +38,8 @@ DEFAULT_APPLET_CREATOR="Pyta"
READ
=
1
WRITE
=
2
# Parameter for FSOpenResourceFile
RESOURCE_FORK_NAME
=
Carbon
.
File
.
FSGetResourceForkName
()
def
findtemplate
(
template
=
None
):
"""Locate the applet template along sys.path"""
...
...
@@ -50,9 +52,9 @@ def findtemplate(template=None):
for
p
in
sys
.
path
:
file
=
os
.
path
.
join
(
p
,
template
)
try
:
file
,
d1
,
d2
=
macfs
.
ResolveAliasFile
(
file
)
file
,
d1
,
d2
=
Carbon
.
File
.
FSResolveAliasFile
(
file
,
1
)
break
except
(
macfs
.
error
,
ValueError
):
except
(
Carbon
.
File
.
error
,
ValueError
):
continue
else
:
raise
BuildError
,
"Template
%
s not found on sys.path"
%
`template`
...
...
@@ -145,9 +147,8 @@ def process_common(template, progress, code, rsrcname, destname, is_update,
if
others
:
raise
BuildError
,
"Extra files only allowed for MachoPython applets"
# Create FSSpecs for the various files
template_fss
=
macfs
.
FSSpec
(
template
)
template_fss
,
d1
,
d2
=
macfs
.
ResolveAliasFile
(
template_fss
)
dest_fss
=
macfs
.
FSSpec
(
destname
)
template_fsr
,
d1
,
d2
=
Carbon
.
File
.
FSResolveAliasFile
(
template
,
1
)
template
=
template_fsr
.
as_pathname
()
# Copy data (not resources, yet) from the template
if
progress
:
...
...
@@ -171,15 +172,16 @@ def process_common(template, progress, code, rsrcname, destname, is_update,
progress
.
label
(
"Copy resources..."
)
progress
.
set
(
20
)
try
:
output
=
Res
.
FS
pOpenResFile
(
dest_fss
,
WRITE
)
output
=
Res
.
FS
OpenResourceFile
(
destname
,
RESOURCE_FORK_NAME
,
WRITE
)
except
MacOS
.
Error
:
Res
.
FSpCreateResFile
(
destname
,
'????'
,
'APPL'
,
MACFS
.
smAllScripts
)
output
=
Res
.
FSpOpenResFile
(
dest_fss
,
WRITE
)
destdir
,
destfile
=
os
.
path
.
split
(
destname
)
Res
.
FSCreateResourceFile
(
destdir
,
destfile
,
RESOURCE_FORK_NAME
)
output
=
Res
.
FSOpenResourceFile
(
destname
,
RESOURCE_FORK_NAME
,
WRITE
)
# Copy the resources from the target specific resource template, if any
typesfound
,
ownertype
=
[],
None
try
:
input
=
Res
.
FS
pOpenResFile
(
rsrcname
,
READ
)
input
=
Res
.
FS
OpenResourceFile
(
rsrcname
,
RESOURCE_FORK_NAME
,
READ
)
except
(
MacOS
.
Error
,
ValueError
):
pass
if
progress
:
...
...
@@ -204,7 +206,7 @@ def process_common(template, progress, code, rsrcname, destname, is_update,
# Copy the resources from the template
input
=
Res
.
FS
pOpenResFile
(
template_fss
,
READ
)
input
=
Res
.
FS
OpenResourceFile
(
template
,
RESOURCE_FORK_NAME
,
READ
)
dummy
,
tmplowner
=
copyres
(
input
,
output
,
skiptypes
,
1
,
progress
)
Res
.
CloseResFile
(
input
)
...
...
@@ -257,15 +259,17 @@ def process_common(template, progress, code, rsrcname, destname, is_update,
Res
.
CloseResFile
(
output
)
# Now set the creator, type and bundle bit of the destination
dest_finfo
=
dest_fss
.
GetFInfo
()
# Now set the creator, type and bundle bit of the destination.
# Done with FSSpec's, FSRef FInfo isn't good enough yet (2.3a1+)
dset_fss
=
Carbon
.
File
.
FSSpec
(
destname
)
dest_finfo
=
dest_fss
.
FSpGetFInfo
()
dest_finfo
.
Creator
=
ownertype
dest_finfo
.
Type
=
'APPL'
dest_finfo
.
Flags
=
dest_finfo
.
Flags
|
MACFS
.
kHasBundle
|
MACFS
.
kIsShared
dest_finfo
.
Flags
=
dest_finfo
.
Flags
&
~
MACFS
.
kHasBeenInited
dest_fss
.
SetFInfo
(
dest_finfo
)
dest_finfo
.
Flags
=
dest_finfo
.
Flags
|
Carbon
.
Files
.
kHasBundle
|
Carbon
.
Files
.
kIsShared
dest_finfo
.
Flags
=
dest_finfo
.
Flags
&
~
Carbon
.
Files
.
kHasBeenInited
dest_fss
.
FSp
SetFInfo
(
dest_finfo
)
macostools
.
touched
(
dest
_fss
)
macostools
.
touched
(
dest
name
)
if
progress
:
progress
.
label
(
"Done."
)
progress
.
inc
(
0
)
...
...
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