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
043baf9b
Commit
043baf9b
authored
Jun 20, 2000
by
Jack Jansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replaced OpenResFile calls with FSpOpenResFile calls (which are carbon-compatible).
parent
8e23b268
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
21 additions
and
21 deletions
+21
-21
Mac/Lib/cfmfile.py
Mac/Lib/cfmfile.py
+2
-2
Mac/Lib/test/tlist_dialog.py
Mac/Lib/test/tlist_dialog.py
+1
-1
Mac/Tools/CGI/BuildCGIApplet.py
Mac/Tools/CGI/BuildCGIApplet.py
+1
-1
Mac/Tools/IDE/BuildIDE.py
Mac/Tools/IDE/BuildIDE.py
+2
-2
Mac/Tools/IDE/PyEdit.py
Mac/Tools/IDE/PyEdit.py
+3
-3
Mac/Tools/macfreeze/macfreezegui.py
Mac/Tools/macfreeze/macfreezegui.py
+1
-1
Mac/Tools/macfreeze/macgen_bin.py
Mac/Tools/macfreeze/macgen_bin.py
+3
-3
Mac/Tools/twit/mactwit_app.py
Mac/Tools/twit/mactwit_app.py
+1
-1
Mac/Tools/twit/mactwit_browser.py
Mac/Tools/twit/mactwit_browser.py
+1
-1
Mac/scripts/BuildApplication.py
Mac/scripts/BuildApplication.py
+1
-1
Mac/scripts/EditPythonPrefs.py
Mac/scripts/EditPythonPrefs.py
+1
-1
Mac/scripts/MkDistr_ui.py
Mac/scripts/MkDistr_ui.py
+2
-2
Mac/scripts/RunLibScript.py
Mac/scripts/RunLibScript.py
+1
-1
Mac/scripts/fullbuild.py
Mac/scripts/fullbuild.py
+1
-1
No files found.
Mac/Lib/cfmfile.py
View file @
043baf9b
...
@@ -34,7 +34,7 @@ def mergecfmfiles(srclist, dst, architecture = 'fat'):
...
@@ -34,7 +34,7 @@ def mergecfmfiles(srclist, dst, architecture = 'fat'):
dst
=
dst
.
as_pathname
()
dst
=
dst
.
as_pathname
()
dstfile
=
open
(
dst
,
"wb"
)
dstfile
=
open
(
dst
,
"wb"
)
rf
=
Res
.
OpenResFile
(
dst
)
rf
=
Res
.
FSpOpenResFile
(
dst
,
3
)
try
:
try
:
dstcfrg
=
CfrgResource
()
dstcfrg
=
CfrgResource
()
for
src
in
srclist
:
for
src
in
srclist
:
...
@@ -64,7 +64,7 @@ class CfrgResource:
...
@@ -64,7 +64,7 @@ class CfrgResource:
self
.
path
=
path
self
.
path
=
path
if
path
is
not
None
and
os
.
path
.
exists
(
path
):
if
path
is
not
None
and
os
.
path
.
exists
(
path
):
currentresref
=
Res
.
CurResFile
()
currentresref
=
Res
.
CurResFile
()
resref
=
Res
.
OpenResFile
(
path
)
resref
=
Res
.
FSpOpenResFile
(
path
,
1
)
Res
.
UseResFile
(
resref
)
Res
.
UseResFile
(
resref
)
try
:
try
:
try
:
try
:
...
...
Mac/Lib/test/tlist_dialog.py
View file @
043baf9b
...
@@ -71,7 +71,7 @@ def dodialog(items):
...
@@ -71,7 +71,7 @@ def dodialog(items):
def
test
():
def
test
():
import
os
,
sys
import
os
,
sys
Res
.
OpenResFile
(
'tlist_dialog.rsrc'
)
Res
.
FSpOpenResFile
(
'tlist_dialog.rsrc'
,
1
)
dodialog
(
os
.
listdir
(
':'
))
dodialog
(
os
.
listdir
(
':'
))
sys
.
exit
(
1
)
sys
.
exit
(
1
)
...
...
Mac/Tools/CGI/BuildCGIApplet.py
View file @
043baf9b
...
@@ -64,7 +64,7 @@ def mkcgifilename(filename):
...
@@ -64,7 +64,7 @@ def mkcgifilename(filename):
def
buildone
(
template
,
wrapper
,
src
,
dst
):
def
buildone
(
template
,
wrapper
,
src
,
dst
):
buildtools
.
process
(
template
,
wrapper
,
dst
,
1
)
buildtools
.
process
(
template
,
wrapper
,
dst
,
1
)
# write source as a PYC resource into dst
# write source as a PYC resource into dst
ref
=
Res
.
OpenResFile
(
dst
)
ref
=
Res
.
FSpOpenResFile
(
dst
,
1
)
try
:
try
:
Res
.
UseResFile
(
ref
)
Res
.
UseResFile
(
ref
)
py_resource
.
frompyfile
(
src
,
"CGI_MAIN"
,
preload
=
1
)
py_resource
.
frompyfile
(
src
,
"CGI_MAIN"
,
preload
=
1
)
...
...
Mac/Tools/IDE/BuildIDE.py
View file @
043baf9b
...
@@ -19,7 +19,7 @@ dstfilename = os.path.join(sys.exec_prefix, "Python IDE")
...
@@ -19,7 +19,7 @@ dstfilename = os.path.join(sys.exec_prefix, "Python IDE")
buildtools
.
process
(
template
,
mainfilename
,
dstfilename
,
1
)
buildtools
.
process
(
template
,
mainfilename
,
dstfilename
,
1
)
targetref
=
Res
.
OpenResFile
(
dstfilename
)
targetref
=
Res
.
FSpOpenResFile
(
dstfilename
,
3
)
Res
.
UseResFile
(
targetref
)
Res
.
UseResFile
(
targetref
)
files
=
os
.
listdir
(
ide_home
)
files
=
os
.
listdir
(
ide_home
)
...
@@ -36,6 +36,6 @@ for name in files:
...
@@ -36,6 +36,6 @@ for name in files:
ispackage
=
0
)
ispackage
=
0
)
# add W resources
# add W resources
wresref
=
Res
.
OpenResFile
(
os
.
path
.
join
(
ide_home
,
"Widgets.rsrc"
)
)
wresref
=
Res
.
FSpOpenResFile
(
os
.
path
.
join
(
ide_home
,
"Widgets.rsrc"
),
1
)
buildtools
.
copyres
(
wresref
,
targetref
,
[],
0
)
buildtools
.
copyres
(
wresref
,
targetref
,
[],
0
)
Mac/Tools/IDE/PyEdit.py
View file @
043baf9b
...
@@ -114,7 +114,7 @@ class Editor(W.Window):
...
@@ -114,7 +114,7 @@ class Editor(W.Window):
def
readwindowsettings
(
self
):
def
readwindowsettings
(
self
):
try
:
try
:
resref
=
Res
.
OpenResFile
(
self
.
path
)
resref
=
Res
.
FSpOpenResFile
(
self
.
path
,
1
)
except
Res
.
Error
:
except
Res
.
Error
:
return
return
try
:
try
:
...
@@ -127,10 +127,10 @@ class Editor(W.Window):
...
@@ -127,10 +127,10 @@ class Editor(W.Window):
def
writewindowsettings
(
self
):
def
writewindowsettings
(
self
):
try
:
try
:
resref
=
Res
.
OpenResFile
(
self
.
path
)
resref
=
Res
.
FSpOpenResFile
(
self
.
path
,
3
)
except
Res
.
Error
:
except
Res
.
Error
:
Res
.
CreateResFile
(
self
.
path
)
Res
.
CreateResFile
(
self
.
path
)
resref
=
Res
.
OpenResFile
(
self
.
path
)
resref
=
Res
.
FSpOpenResFile
(
self
.
path
,
3
)
try
:
try
:
data
=
Res
.
Resource
(
marshal
.
dumps
(
self
.
settings
))
data
=
Res
.
Resource
(
marshal
.
dumps
(
self
.
settings
))
Res
.
UseResFile
(
resref
)
Res
.
UseResFile
(
resref
)
...
...
Mac/Tools/macfreeze/macfreezegui.py
View file @
043baf9b
...
@@ -60,7 +60,7 @@ def dialog(script=None):
...
@@ -60,7 +60,7 @@ def dialog(script=None):
d
=
None
d
=
None
if
d
==
None
:
if
d
==
None
:
try
:
try
:
Res
.
OpenResFile
(
'macfreeze.rsrc'
)
Res
.
FSpOpenResFile
(
'macfreeze.rsrc'
,
1
)
except
Res
.
Error
:
except
Res
.
Error
:
d
=
None
d
=
None
else
:
else
:
...
...
Mac/Tools/macfreeze/macgen_bin.py
View file @
043baf9b
...
@@ -39,7 +39,7 @@ def generate(input, output, module_dict=None, architecture='fat', debug=0):
...
@@ -39,7 +39,7 @@ def generate(input, output, module_dict=None, architecture='fat', debug=0):
print
'Adding "__main__"'
print
'Adding "__main__"'
buildtools
.
process
(
applettemplatepath
,
input
,
output
,
0
)
buildtools
.
process
(
applettemplatepath
,
input
,
output
,
0
)
outputref
=
Res
.
OpenResFile
(
output
)
outputref
=
Res
.
FSpOpenResFile
(
output
,
3
)
try
:
try
:
Res
.
UseResFile
(
outputref
)
Res
.
UseResFile
(
outputref
)
...
@@ -171,10 +171,10 @@ def makefilenames(name):
...
@@ -171,10 +171,10 @@ def makefilenames(name):
def
copyres
(
input
,
output
,
*
args
,
**
kwargs
):
def
copyres
(
input
,
output
,
*
args
,
**
kwargs
):
openedin
=
openedout
=
0
openedin
=
openedout
=
0
if
type
(
input
)
==
types
.
StringType
:
if
type
(
input
)
==
types
.
StringType
:
input
=
Res
.
OpenResFile
(
input
)
input
=
Res
.
FSpOpenResFile
(
input
,
1
)
openedin
=
1
openedin
=
1
if
type
(
output
)
==
types
.
StringType
:
if
type
(
output
)
==
types
.
StringType
:
output
=
Res
.
OpenResFile
(
output
)
output
=
Res
.
FSpOpenResFile
(
output
,
3
)
openedout
=
1
openedout
=
1
try
:
try
:
apply
(
buildtools
.
copyres
,
(
input
,
output
)
+
args
,
kwargs
)
apply
(
buildtools
.
copyres
,
(
input
,
output
)
+
args
,
kwargs
)
...
...
Mac/Tools/twit/mactwit_app.py
View file @
043baf9b
...
@@ -260,7 +260,7 @@ def Initialize():
...
@@ -260,7 +260,7 @@ def Initialize():
dummy
=
Res
.
GetResource
(
'DLOG'
,
ID_MODULES
)
dummy
=
Res
.
GetResource
(
'DLOG'
,
ID_MODULES
)
except
Res
.
Error
:
except
Res
.
Error
:
try
:
try
:
Res
.
OpenResFile
(
"Twit.rsrc"
)
Res
.
FSpOpenResFile
(
"Twit.rsrc"
,
1
)
except
Res
.
Error
,
arg
:
except
Res
.
Error
,
arg
:
EasyDialogs
.
Message
(
"Cannot open Twit.rsrc: "
+
arg
[
1
])
EasyDialogs
.
Message
(
"Cannot open Twit.rsrc: "
+
arg
[
1
])
sys
.
exit
(
1
)
sys
.
exit
(
1
)
...
...
Mac/Tools/twit/mactwit_browser.py
View file @
043baf9b
...
@@ -61,7 +61,7 @@ def Initialize():
...
@@ -61,7 +61,7 @@ def Initialize():
ourparentdir
=
os
.
path
.
split
(
openresfile
.
func_code
.
co_filename
)[
0
]
ourparentdir
=
os
.
path
.
split
(
openresfile
.
func_code
.
co_filename
)[
0
]
os
.
chdir
(
ourparentdir
)
os
.
chdir
(
ourparentdir
)
try
:
try
:
Res
.
OpenResFile
(
"mactwit_browse.rsrc"
)
Res
.
FSpOpenResFile
(
"mactwit_browse.rsrc"
,
1
)
except
Res
.
Error
,
arg
:
except
Res
.
Error
,
arg
:
EasyDialogs
.
Message
(
"Cannot open mactwit_browse.rsrc: "
+
arg
[
1
])
EasyDialogs
.
Message
(
"Cannot open mactwit_browse.rsrc: "
+
arg
[
1
])
sys
.
exit
(
1
)
sys
.
exit
(
1
)
...
...
Mac/scripts/BuildApplication.py
View file @
043baf9b
...
@@ -38,7 +38,7 @@ GEN68K_BUTTON = 6
...
@@ -38,7 +38,7 @@ GEN68K_BUTTON = 6
try
:
try
:
Res
.
GetResource
(
'DITL'
,
DLG_ID
)
Res
.
GetResource
(
'DITL'
,
DLG_ID
)
except
Res
.
Error
:
except
Res
.
Error
:
Res
.
OpenResFile
(
"BuildApplication.rsrc"
)
Res
.
FSpOpenResFile
(
"BuildApplication.rsrc"
,
1
)
else
:
else
:
pass
# we're an applet
pass
# we're an applet
...
...
Mac/scripts/EditPythonPrefs.py
View file @
043baf9b
...
@@ -170,7 +170,7 @@ def edit_applet(name):
...
@@ -170,7 +170,7 @@ def edit_applet(name):
def
main
():
def
main
():
try
:
try
:
h
=
OpenResFile
(
'EditPythonPrefs.rsrc'
)
h
=
FSpOpenResFile
(
'EditPythonPrefs.rsrc'
,
1
)
except
Res
.
Error
:
except
Res
.
Error
:
pass
# Assume we already have acces to our own resource
pass
# Assume we already have acces to our own resource
...
...
Mac/scripts/MkDistr_ui.py
View file @
043baf9b
...
@@ -321,7 +321,7 @@ def GetType():
...
@@ -321,7 +321,7 @@ def GetType():
def
InitUI
():
def
InitUI
():
"""Initialize stuff needed by UI (a resource file)"""
"""Initialize stuff needed by UI (a resource file)"""
Res
.
OpenResFile
(
'MkDistr.rsrc'
)
Res
.
FSpOpenResFile
(
'MkDistr.rsrc'
,
1
)
class
_testerhelp
:
class
_testerhelp
:
def
__init__
(
self
,
which
):
def
__init__
(
self
,
which
):
...
@@ -340,7 +340,7 @@ class _testerhelp:
...
@@ -340,7 +340,7 @@ class _testerhelp:
class
_test
:
class
_test
:
def
__init__
(
self
):
def
__init__
(
self
):
import
sys
import
sys
Res
.
OpenResFile
(
'MkDistr.rsrc'
)
Res
.
FSpOpenResFile
(
'MkDistr.rsrc'
,
1
)
self
.
inc
=
_testerhelp
(
'include'
)
self
.
inc
=
_testerhelp
(
'include'
)
self
.
exc
=
_testerhelp
(
'exclude'
)
self
.
exc
=
_testerhelp
(
'exclude'
)
self
.
ui
=
MkDistrUI
(
self
)
self
.
ui
=
MkDistrUI
(
self
)
...
...
Mac/scripts/RunLibScript.py
View file @
043baf9b
...
@@ -85,7 +85,7 @@ def main():
...
@@ -85,7 +85,7 @@ def main():
curdir
=
os
.
getcwd
()
curdir
=
os
.
getcwd
()
import
Res
import
Res
try
:
try
:
Res
.
OpenResFile
(
'RunLibScript.rsrc'
)
Res
.
FSpOpenResFile
(
'RunLibScript.rsrc'
,
1
)
except
:
except
:
pass
# Assume we're an applet already
pass
# Assume we're an applet already
name
,
argv
,
stdin
,
stdout
,
wdir
,
pause
=
interact
()
name
,
argv
,
stdin
,
stdout
,
wdir
,
pause
=
interact
()
...
...
Mac/scripts/fullbuild.py
View file @
043baf9b
...
@@ -270,7 +270,7 @@ def incbuildno(filename):
...
@@ -270,7 +270,7 @@ def incbuildno(filename):
def
main
():
def
main
():
try
:
try
:
h
=
Res
.
OpenResFile
(
'fullbuild.rsrc'
)
h
=
Res
.
FSpOpenResFile
(
'fullbuild.rsrc'
,
1
)
except
Res
.
Error
:
except
Res
.
Error
:
pass
# Assume we already have acces to our own resource
pass
# Assume we already have acces to our own resource
...
...
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