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
4092606d
Commit
4092606d
authored
Mar 30, 2002
by
Jack Jansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modified to allow it to run in MachoPython in a reasonable way. It still
needs a decent commandline interface, though.
parent
c2ce91af
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
10 deletions
+17
-10
Mac/scripts/gensuitemodule.py
Mac/scripts/gensuitemodule.py
+17
-10
No files found.
Mac/scripts/gensuitemodule.py
View file @
4092606d
...
...
@@ -14,10 +14,17 @@ import types
import
StringIO
import
macfs
import
keyword
import
macresource
from
Carbon.Res
import
*
DEFAULT_PACKAGEFOLDER
=
os
.
path
.
join
(
sys
.
prefix
,
'Mac'
,
'Lib'
,
'lib-scriptpackages'
)
def
main
():
if
len
(
sys
.
argv
)
>
1
:
for
filename
in
sys
.
argv
[
1
:]:
processfile
(
filename
)
else
:
fss
,
ok
=
macfs
.
PromptGetFile
(
'Select file with aeut/aete resource:'
)
if
not
ok
:
sys
.
exit
(
0
)
...
...
@@ -26,8 +33,8 @@ def main():
def
processfile
(
fullname
):
"""Process all resources in a single file"""
cur
=
CurResFile
()
print
fullname
rf
=
OpenRFPerm
(
fullname
,
0
,
1
)
print
"Processing"
,
fullname
rf
=
macresource
.
open_pathname
(
fullname
)
try
:
UseResFile
(
rf
)
resources
=
[]
...
...
@@ -225,15 +232,15 @@ def compileaete(aete, resinfo, fname):
major
,
minor
=
divmod
(
version
,
256
)
fss
=
macfs
.
FSSpec
(
fname
)
creatorsignature
,
dummy
=
fss
.
GetCreatorType
()
packagename
=
identify
(
os
.
path
.
basename
(
fname
)
)
packagename
=
identify
(
os
.
path
.
splitext
(
os
.
path
.
basename
(
fname
))[
0
]
)
if
language
:
packagename
=
packagename
+
'_lang%d'
%
language
if
script
:
packagename
=
packagename
+
'_script%d'
%
script
if
len
(
packagename
)
>
27
:
packagename
=
packagename
[:
27
]
macfs
.
SetFolder
(
os
.
path
.
join
(
sys
.
prefix
,
':Mac:Lib:lib-scriptpackages'
)
)
fss
,
ok
=
macfs
.
GetDirectory
(
'
P
ackage folder for %s'
%
packagename
)
macfs
.
SetFolder
(
DEFAULT_PACKAGEFOLDER
)
fss
,
ok
=
macfs
.
GetDirectory
(
'
Create and select p
ackage folder for %s'
%
packagename
)
if
not
ok
:
return
pathname
=
fss
.
as_pathname
()
...
...
@@ -288,7 +295,7 @@ def compileaete(aete, resinfo, fname):
for
code
,
modname
in
suitelist
[
1
:]:
fp
.
write
(
",
\
n
\
t
\
t
%s_Events"
%
modname
)
fp
.
write
(
",
\
n
\
t
\
t
aetools.TalkTo):
\
n
"
)
fp
.
write
(
"
\
t
_signature =
'%s'
\
n
\
n
"
%
creatorsignature
)
fp
.
write
(
"
\
t
_signature =
%s
\
n
\
n
"
%
`creatorsignature`
)
fp
.
close
()
def
precompilesuite
(
suite
,
basepackage
=
None
):
...
...
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