regsetup.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:remoteControlPPT 作者: htwenning 项目源码 文件源码
def FindPackagePath(packageName, knownFileName, searchPaths):
    """Find a package.

       Given a ni style package name, check the package is registered.

       First place looked is the registry for an existing entry.  Then
       the searchPaths are searched.
    """
    import regutil, os
    pathLook = regutil.GetRegisteredNamedPath(packageName)
    if pathLook and IsPackageDir(pathLook, packageName, knownFileName):
        return pathLook, None # The currently registered one is good.
    # Search down the search paths.
    for pathLook in searchPaths:
        if IsPackageDir(pathLook, packageName, knownFileName):
            # Found it
            ret = os.path.abspath(pathLook)
            return ret, ret
    raise error("The package %s can not be located" % packageName)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号