[Python-checkins] CVS: python/dist/src/Mac/Lib macresource.py,1.1,1.2
Jack Jansen
jackjansen@users.sourceforge.net
Mon, 27 Aug 2001 14:37:47 -0700
Update of /cvsroot/python/python/dist/src/Mac/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv3854/Python/Mac/Lib
Modified Files:
macresource.py
Log Message:
need() now returns the refno of the resource file opened, or None if the
specified resource was already available and no file was opened.
Index: macresource.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Lib/macresource.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** macresource.py 2001/08/27 21:21:07 1.1
--- macresource.py 2001/08/27 21:37:45 1.2
***************
*** 13,17 ****
is available we are done. If it is not available we look for a file filename
(default: modname with .rsrc appended) either in the same folder as
! where modname was loaded from, or otherwise across sys.path."""
if modname is None and filename is None:
--- 13,19 ----
is available we are done. If it is not available we look for a file filename
(default: modname with .rsrc appended) either in the same folder as
! where modname was loaded from, or otherwise across sys.path.
!
! Returns the refno of the resource file opened (or None)"""
if modname is None and filename is None:
***************
*** 24,28 ****
pass
else:
! return
else:
try:
--- 26,30 ----
pass
else:
! return None
else:
try:
***************
*** 31,35 ****
pass
else:
! return
# Construct a filename if we don't have one
--- 33,37 ----
pass
else:
! return None
# Construct a filename if we don't have one
***************
*** 60,64 ****
raise ResourceFileNotFoundError, filename
! Res.FSpOpenResFile(pathname, 1)
# And check that the resource exists now
--- 62,66 ----
raise ResourceFileNotFoundError, filename
! refno = Res.FSpOpenResFile(pathname, 1)
# And check that the resource exists now
***************
*** 67,68 ****
--- 69,71 ----
else:
h = Res.GetNamedResource(restype, resid)
+ return refno
\ No newline at end of file