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
7c86b218
Kaydet (Commit)
7c86b218
authored
Agu 31, 1995
tarafından
Jack Jansen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
- Allow PythonApplet to be an alias
- Correctly set bundle and init bits
üst
8094f0dd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
15 deletions
+22
-15
BuildApplet.py
Mac/scripts/BuildApplet.py
+22
-15
No files found.
Mac/scripts/BuildApplet.py
Dosyayı görüntüle @
7c86b218
...
@@ -14,6 +14,7 @@ import os
...
@@ -14,6 +14,7 @@ import os
import
marshal
import
marshal
import
imp
import
imp
import
macfs
import
macfs
import
MACFS
import
MacOS
import
MacOS
from
Res
import
*
from
Res
import
*
...
@@ -42,17 +43,15 @@ def main():
...
@@ -42,17 +43,15 @@ def main():
for
p
in
sys
.
path
:
for
p
in
sys
.
path
:
template
=
os
.
path
.
join
(
p
,
TEMPLATE
)
template
=
os
.
path
.
join
(
p
,
TEMPLATE
)
try
:
try
:
tmpl
=
open
(
template
,
"rb"
)
template
,
d1
,
d2
=
macfs
.
ResolveAliasFile
(
template
)
tmpl
.
close
()
break
break
except
IOError
:
except
(
macfs
.
error
,
ValueError
)
:
continue
continue
else
:
else
:
die
(
"Template
%
s not found
"
%
`template
`
)
die
(
"Template
%
s not found
on sys.path"
%
`TEMPLATE
`
)
return
return
template
=
template
.
as_pathname
()
# Convert to full pathname
print
'Using template'
,
template
template
=
macfs
.
FSSpec
(
template
)
.
as_pathname
()
# Ask for source text if not specified in sys.argv[1:]
# Ask for source text if not specified in sys.argv[1:]
...
@@ -106,6 +105,10 @@ def process(template, filename, output):
...
@@ -106,6 +105,10 @@ def process(template, filename, output):
destname
=
output
destname
=
output
# Copy the data from the template (creating the file as well)
# Copy the data from the template (creating the file as well)
template_fss
=
macfs
.
FSSpec
(
template
)
template_fss
,
d1
,
d2
=
macfs
.
ResolveAliasFile
(
template_fss
)
dest_fss
=
macfs
.
FSSpec
(
destname
)
tmpl
=
open
(
template
,
"rb"
)
tmpl
=
open
(
template
,
"rb"
)
dest
=
open
(
destname
,
"wb"
)
dest
=
open
(
destname
,
"wb"
)
data
=
tmpl
.
read
()
data
=
tmpl
.
read
()
...
@@ -117,23 +120,23 @@ def process(template, filename, output):
...
@@ -117,23 +120,23 @@ def process(template, filename, output):
# Copy the creator of the template to the destination
# Copy the creator of the template to the destination
# unless it already got one. Set type to APPL
# unless it already got one. Set type to APPL
tctor
,
ttype
=
MacOS
.
GetCreatorAndType
(
template
)
tctor
,
ttype
=
template_fss
.
GetCreatorType
(
)
ctor
,
type
=
MacOS
.
GetCreatorAndType
(
destname
)
ctor
,
type
=
dest_fss
.
GetCreatorType
(
)
if
type
in
undefs
:
type
=
'APPL'
if
type
in
undefs
:
type
=
'APPL'
if
ctor
in
undefs
:
ctor
=
tctor
if
ctor
in
undefs
:
ctor
=
tctor
# Open the output resource fork
# Open the output resource fork
try
:
try
:
output
=
FSpOpenResFile
(
dest
name
,
WRITE
)
output
=
FSpOpenResFile
(
dest
_fss
,
WRITE
)
except
MacOS
.
Error
:
except
MacOS
.
Error
:
print
"Creating resource fork..."
print
"Creating resource fork..."
CreateResFile
(
destname
)
CreateResFile
(
destname
)
output
=
FSpOpenResFile
(
dest
name
,
WRITE
)
output
=
FSpOpenResFile
(
dest
_fss
,
WRITE
)
# Copy the resources from the template
# Copy the resources from the template
input
=
FSpOpenResFile
(
template
,
READ
)
input
=
FSpOpenResFile
(
template
_fss
,
READ
)
newctor
=
copyres
(
input
,
output
)
newctor
=
copyres
(
input
,
output
)
CloseResFile
(
input
)
CloseResFile
(
input
)
if
newctor
:
ctor
=
newctor
if
newctor
:
ctor
=
newctor
...
@@ -149,9 +152,13 @@ def process(template, filename, output):
...
@@ -149,9 +152,13 @@ def process(template, filename, output):
CloseResFile
(
input
)
CloseResFile
(
input
)
if
newctor
:
ctor
=
newctor
if
newctor
:
ctor
=
newctor
# Now set the creator and type of the destination
# Now set the creator, type and bundle bit of the destination
dest_finfo
=
dest_fss
.
GetFInfo
()
MacOS
.
SetCreatorAndType
(
destname
,
ctor
,
type
)
dest_finfo
.
Creator
=
ctor
dest_finfo
.
Type
=
type
dest_finfo
.
Flags
=
dest_finfo
.
Flags
|
MACFS
.
kHasBundle
dest_finfo
.
Flags
=
dest_finfo
.
Flags
&
~
MACFS
.
kHasBeenInited
dest_fss
.
SetFInfo
(
dest_finfo
)
# Make sure we're manipulating the output resource file now
# Make sure we're manipulating the output resource file now
...
...
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