当前位置: 首页>>代码示例>>Python>>正文


Python winreg.EnumKey方法代码示例

本文整理汇总了Python中six.moves.winreg.EnumKey方法的典型用法代码示例。如果您正苦于以下问题:Python winreg.EnumKey方法的具体用法?Python winreg.EnumKey怎么用?Python winreg.EnumKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在six.moves.winreg的用法示例。


在下文中一共展示了winreg.EnumKey方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_acroversion

# 需要导入模块: from six.moves import winreg [as 别名]
# 或者: from six.moves.winreg import EnumKey [as 别名]
def get_acroversion():
    " Return version of Adobe Acrobat executable or None"
    from six.moves import winreg
    adobesoft = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r'Software\Adobe')
    for index in range(winreg.QueryInfoKey(adobesoft)[0]):
        key = winreg.EnumKey(adobesoft, index)
        if "acrobat" in key.lower():
            acrokey = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, 'Software\\Adobe\\%s' % key)
            for index in range(winreg.QueryInfoKey(acrokey)[0]):
                numver = winreg.EnumKey(acrokey, index)
                try:
                    res = winreg.QueryValue(winreg.HKEY_LOCAL_MACHINE, 'Software\\Adobe\\%s\\%s\\InstallPath' % (key, numver))
                    return res
                except Exception:
                    pass
    return None 
开发者ID:thiagoralves,项目名称:OpenPLC_Editor,代码行数:18,代码来源:docpdf.py

示例2: enum_keys

# 需要导入模块: from six.moves import winreg [as 别名]
# 或者: from six.moves.winreg import EnumKey [as 别名]
def enum_keys(key):
    at = 0
    while True:
        try:
            yield winreg.EnumKey(key, at)
        except OSError:
            break
        at += 1 
开发者ID:tox-dev,项目名称:tox,代码行数:10,代码来源:pep514.py

示例3: list

# 需要导入模块: from six.moves import winreg [as 别名]
# 或者: from six.moves.winreg import EnumKey [as 别名]
def list():
        """Return a list of all time zones known to the system."""
        with winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE) as handle:
            with winreg.OpenKey(handle, TZKEYNAME) as tzkey:
                result = [winreg.EnumKey(tzkey, i)
                          for i in range(winreg.QueryInfoKey(tzkey)[0])]
        return result 
开发者ID:MediaBrowser,项目名称:plugin.video.emby,代码行数:9,代码来源:win.py

示例4: list

# 需要导入模块: from six.moves import winreg [as 别名]
# 或者: from six.moves.winreg import EnumKey [as 别名]
def list():
        """Return a list of all time zones known to the system."""
        handle = winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE)
        tzkey = winreg.OpenKey(handle, TZKEYNAME)
        result = [winreg.EnumKey(tzkey, i)
                  for i in range(winreg.QueryInfoKey(tzkey)[0])]
        tzkey.Close()
        handle.Close()
        return result 
开发者ID:Solid-Mechanics,项目名称:matplotlib-4-abaqus,代码行数:11,代码来源:tzwin.py

示例5: find_available_vc_vers

# 需要导入模块: from six.moves import winreg [as 别名]
# 或者: from six.moves.winreg import EnumKey [as 别名]
def find_available_vc_vers(self):
        """
        Find all available Microsoft Visual C++ versions.
        """
        vckeys = (self.ri.vc, self.ri.vc_for_python)
        vc_vers = []
        for hkey in self.ri.HKEYS:
            for key in vckeys:
                try:
                    bkey = winreg.OpenKey(hkey, key, 0, winreg.KEY_READ)
                except (OSError, IOError):
                    continue
                subkeys, values, _ = winreg.QueryInfoKey(bkey)
                for i in range(values):
                    try:
                        ver = float(winreg.EnumValue(bkey, i)[0])
                        if ver not in vc_vers:
                            vc_vers.append(ver)
                    except ValueError:
                        pass
                for i in range(subkeys):
                    try:
                        ver = float(winreg.EnumKey(bkey, i))
                        if ver not in vc_vers:
                            vc_vers.append(ver)
                    except ValueError:
                        pass
        return sorted(vc_vers) 
开发者ID:proxysh,项目名称:Safejumper-for-Desktop,代码行数:30,代码来源:msvc.py

示例6: find_available_vc_vers

# 需要导入模块: from six.moves import winreg [as 别名]
# 或者: from six.moves.winreg import EnumKey [as 别名]
def find_available_vc_vers(self):
        """
        Find all available Microsoft Visual C++ versions.
        """
        ms = self.ri.microsoft
        vckeys = (self.ri.vc, self.ri.vc_for_python, self.ri.vs)
        vc_vers = []
        for hkey in self.ri.HKEYS:
            for key in vckeys:
                try:
                    bkey = winreg.OpenKey(hkey, ms(key), 0, winreg.KEY_READ)
                except (OSError, IOError):
                    continue
                subkeys, values, _ = winreg.QueryInfoKey(bkey)
                for i in range(values):
                    try:
                        ver = float(winreg.EnumValue(bkey, i)[0])
                        if ver not in vc_vers:
                            vc_vers.append(ver)
                    except ValueError:
                        pass
                for i in range(subkeys):
                    try:
                        ver = float(winreg.EnumKey(bkey, i))
                        if ver not in vc_vers:
                            vc_vers.append(ver)
                    except ValueError:
                        pass
        return sorted(vc_vers) 
开发者ID:priyankark,项目名称:PhonePi_SampleServer,代码行数:31,代码来源:msvc.py


注:本文中的six.moves.winreg.EnumKey方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。