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
c8b40892
Commit
c8b40892
authored
Mar 21, 2002
by
Jack Jansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added an open_pathname() method which opens a resource file by pathname,
possibly converting from AppleSingle.
parent
0b60150f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
Mac/Lib/macresource.py
Mac/Lib/macresource.py
+12
-7
No files found.
Mac/Lib/macresource.py
View file @
c8b40892
...
...
@@ -61,6 +61,18 @@ def need(restype, resid, filename=None, modname=None):
else
:
raise
ResourceFileNotFoundError
,
filename
refno
=
open_pathname
(
pathname
)
# And check that the resource exists now
if
type
(
resid
)
is
type
(
1
):
h
=
Res
.
GetResource
(
restype
,
resid
)
else
:
h
=
Res
.
GetNamedResource
(
restype
,
resid
)
return
refno
def
open_pathname
(
pathname
):
"""Open a resource file given by pathname, possibly decoding an
AppleSingle file"""
try
:
refno
=
Res
.
FSpOpenResFile
(
pathname
,
1
)
except
Res
.
Error
,
arg
:
...
...
@@ -72,13 +84,6 @@ def need(restype, resid, filename=None, modname=None):
refno
=
Res
.
FSOpenResourceFile
(
pathname
,
u''
,
1
)
else
:
raise
# And check that the resource exists now
if
type
(
resid
)
is
type
(
1
):
h
=
Res
.
GetResource
(
restype
,
resid
)
else
:
h
=
Res
.
GetNamedResource
(
restype
,
resid
)
return
refno
def
_decode
(
pathname
):
...
...
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