regsetup.py 文件源码

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

项目:remoteControlPPT 作者: htwenning 项目源码 文件源码
def FindAppPath(appName, knownFileName, searchPaths):
    """Find an application.

     First place looked is the registry for an existing entry.  Then
     the searchPaths are searched.
    """
    # Look in the first path.
    import regutil, string, os
    regPath = regutil.GetRegisteredNamedPath(appName)
    if regPath:
        pathLook = regPath.split(";")[0]
    if regPath and FileExists(os.path.join(pathLook, knownFileName)):
        return None # The currently registered one is good.
    # Search down the search paths.
    for pathLook in searchPaths:
        if FileExists(os.path.join(pathLook, knownFileName)):
            # Found it
            return os.path.abspath(pathLook)
    raise error("The file %s can not be located for application %s" % (knownFileName, appName))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号