regutil.py 文件源码

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

项目:purelove 作者: hucmosin 项目源码 文件源码
def UnregisterHelpFile(helpFile, helpDesc = None):
    """Unregister a help file in the registry.

           helpFile -- the base name of the help file.
           helpDesc -- A description for the help file.  If None, the helpFile param is used.
    """
    key = win32api.RegOpenKey(win32con.HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\Help", 0, win32con.KEY_ALL_ACCESS)
    try:
        try:
            win32api.RegDeleteValue(key, helpFile)
        except win32api.error, exc:
            import winerror
            if exc.winerror!=winerror.ERROR_FILE_NOT_FOUND:
                raise
    finally:
        win32api.RegCloseKey(key)

    # Now de-register with Python itself.
    if helpDesc is None: helpDesc = helpFile
    try:
        win32api.RegDeleteKey(GetRootKey(), 
                             BuildDefaultPythonKey() + "\\Help\\%s" % helpDesc) 
    except win32api.error, exc:
        import winerror
        if exc.winerror!=winerror.ERROR_FILE_NOT_FOUND:
            raise
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号