def readPlistFromResource(path, restype='plst', resid=0):
 warnings.warnpy3k('In 3.x, readPlistFromResource is removed.', stacklevel=2)
 from Carbon.File import FSRef, FSGetResourceForkName
 from Carbon.Files import fsRdPerm
 from Carbon import Res
 fsRef = FSRef(path)
 resNum = Res.FSOpenResourceFile(fsRef, FSGetResourceForkName(), fsRdPerm)
 Res.UseResFile(resNum)
 plistData = Res.Get1Resource(restype, resid).data
 Res.CloseResFile(resNum)
 return readPlistFromString(plistData)

def readPlistFromResource ( path , restype = 'plst' , resid = 0 ) : warnings . warnpy3k ( 'In 3.x, readPlistFromResource is removed.' , stacklevel = 2 ) from Carbon . File import FSRef , FSGetResourceForkName from Carbon . Files import fsRdPerm from Carbon import Res fsRef = FSRef ( path ) resNum = Res . FSOpenResourceFile ( fsRef , FSGetResourceForkName ( ) , fsRdPerm ) Res . UseResFile ( resNum ) plistData = Res . Get1Resource ( restype , resid ) . data Res . CloseResFile ( resNum ) return readPlistFromString ( plistData )
read plst resource from the resource fork of path .