Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
162cadde
Commit
162cadde
authored
Mar 20, 2001
by
Jack Jansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Got module to work under Carbon. Also disabled a few more bits of cfm68k support.
parent
6458a6b9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
12 deletions
+21
-12
Mac/Tools/macfreeze/macgen_bin.py
Mac/Tools/macfreeze/macgen_bin.py
+21
-12
No files found.
Mac/Tools/macfreeze/macgen_bin.py
View file @
162cadde
...
@@ -6,6 +6,7 @@ import string
...
@@ -6,6 +6,7 @@ import string
import
types
import
types
import
macfs
import
macfs
from
MACFS
import
*
from
MACFS
import
*
import
MacOS
import
Res
import
Res
import
py_resource
import
py_resource
import
cfmfile
import
cfmfile
...
@@ -96,7 +97,9 @@ def findfragments(module_dict, architecture):
...
@@ -96,7 +97,9 @@ def findfragments(module_dict, architecture):
continue
continue
path
=
resolvealiasfile
(
module
.
__file__
)
path
=
resolvealiasfile
(
module
.
__file__
)
dir
,
filename
=
os
.
path
.
split
(
path
)
dir
,
filename
=
os
.
path
.
split
(
path
)
ppcfile
,
cfm68kfile
=
makefilenames
(
filename
)
## ppcfile, cfm68kfile = makefilenames(filename)
ppcfile
=
filename
cfm68kfile
=
"dummy.cfm68k.slb"
# ppc stuff
# ppc stuff
ppcpath
=
os
.
path
.
join
(
dir
,
ppcfile
)
ppcpath
=
os
.
path
.
join
(
dir
,
ppcfile
)
...
@@ -158,15 +161,15 @@ def Pstring(str):
...
@@ -158,15 +161,15 @@ def Pstring(str):
raise
TypeError
,
"Str255 must be at most 255 chars long"
raise
TypeError
,
"Str255 must be at most 255 chars long"
return
chr
(
len
(
str
))
+
str
return
chr
(
len
(
str
))
+
str
def
makefilenames
(
name
):
##
def makefilenames(name):
lname
=
string
.
lower
(
name
)
##
lname = string.lower(name)
pos
=
string
.
find
(
lname
,
".ppc."
)
##
pos = string.find(lname, ".ppc.")
if
pos
>
0
:
##
if pos > 0:
return
name
,
name
[:
pos
]
+
'.CFM68K.'
+
name
[
pos
+
5
:]
##
return name, name[:pos] + '.CFM68K.' + name[pos+5:]
pos
=
string
.
find
(
lname
,
".cfm68k."
)
##
pos = string.find(lname, ".cfm68k.")
if
pos
>
0
:
##
if pos > 0:
return
name
[:
pos
]
+
'.ppc.'
+
name
[
pos
+
8
:],
name
##
return name[:pos] + '.ppc.' + name[pos+8:], name
raise
ValueError
,
"can't make ppc/cfm68k filenames"
##
raise ValueError, "can't make ppc/cfm68k filenames"
def
copyres
(
input
,
output
,
*
args
,
**
kwargs
):
def
copyres
(
input
,
output
,
*
args
,
**
kwargs
):
openedin
=
openedout
=
0
openedin
=
openedout
=
0
...
@@ -187,10 +190,16 @@ def copyres(input, output, *args, **kwargs):
...
@@ -187,10 +190,16 @@ def copyres(input, output, *args, **kwargs):
def
findpythoncore
():
def
findpythoncore
():
"""find the PythonCore shared library, possibly asking the user if we can't find it"""
"""find the PythonCore shared library, possibly asking the user if we can't find it"""
vRefNum
,
dirID
=
macfs
.
FindFolder
(
kOnSystemDisk
,
k
Extension
FolderType
,
0
)
vRefNum
,
dirID
=
macfs
.
FindFolder
(
kOnSystemDisk
,
k
SharedLibraries
FolderType
,
0
)
extpath
=
macfs
.
FSSpec
((
vRefNum
,
dirID
,
""
)).
as_pathname
()
extpath
=
macfs
.
FSSpec
((
vRefNum
,
dirID
,
""
)).
as_pathname
()
version
=
string
.
split
(
sys
.
version
)[
0
]
version
=
string
.
split
(
sys
.
version
)[
0
]
corepath
=
os
.
path
.
join
(
extpath
,
"PythonCore "
+
version
)
if
MacOS
.
runtimemodel
==
'carbon'
:
corename
=
"PythonCoreCarbon "
+
version
elif
MacOS
.
runtimemodel
==
'ppc'
:
corename
=
"PythonCore "
+
version
else
:
raise
"Unknown MacOS.runtimemodel"
,
MacOS
.
runtimemodel
corepath
=
os
.
path
.
join
(
extpath
,
corename
)
if
not
os
.
path
.
exists
(
corepath
):
if
not
os
.
path
.
exists
(
corepath
):
fss
,
ok
=
macfs
.
PromptGetFile
(
"Please locate PythonCore:"
,
"shlb"
)
fss
,
ok
=
macfs
.
PromptGetFile
(
"Please locate PythonCore:"
,
"shlb"
)
if
not
ok
:
if
not
ok
:
...
...
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