def FindPackagePath(packageName, knownFileName, searchPaths):
 import regutil, os
 pathLook = regutil.GetRegisteredNamedPath(packageName)
 if (pathLook and IsPackageDir(pathLook, packageName, knownFileName)):
  return (pathLook, None)
 for pathLook in searchPaths:
  if IsPackageDir(pathLook, packageName, knownFileName):
   ret = os.path.abspath(pathLook)
   return (ret, ret)
 raise error, ('The package %s can not be located' % packageName)

def FindPackagePath ( packageName , knownFileName , searchPaths ) : import regutil , os pathLook = regutil . GetRegisteredNamedPath ( packageName ) if ( pathLook and IsPackageDir ( pathLook , packageName , knownFileName ) ) : return ( pathLook , None ) for pathLook in searchPaths : if IsPackageDir ( pathLook , packageName , knownFileName ) : ret = os . path . abspath ( pathLook ) return ( ret , ret ) raise error , ( 'The package %s can not be located' % packageName )
find a package .