Skip to main content

Yet Another Registry Wrapper

Project description

YARW: Yet Another Registry Wrapper

This recipe provides “Registry”, a Windows registry wrapper class that makes it easy to work with the Windows registry. The class works with an inner class named “RegistryKey”, which wraps up a Windows registry key and provides methods to access and manipulate the key information. The class provides easy to remember substitutes for long method names of _winreg.

Example

key = Registry.open('HKEY_LOCAL_MACHINE', "SOFTWARE\\Python")
# Prints the RegistryKey instance
print key
# Prints the key name and the wrapped up PyHKEY instance
print key.getkeyname(), key.getkey()
corekey = key.openkey(1)

idx = 0
# Print the install path for Python 2.4 if installed.
while True:
    try:
        keyname = corekey.enumkey(idx)
        idx += 1
        if keyname == '2.4':
            keyVersion = corekey.openkey(idx)
            print keyVersion, keyVersion.getkeyname()
            keyPath = keyVersion.openkey(2)
            print keyPath, keyPath.getkeyname()
            print 'Install path is %s' % keyPath.getvalue()
            keyPath.close()
            keyVersion.close()
            break
    except RegistryError:
        break

corekey.close()
key.close()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

YARW-0.1.5.tar.gz (32.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

YARW-0.1.5-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file YARW-0.1.5.tar.gz.

File metadata

  • Download URL: YARW-0.1.5.tar.gz
  • Upload date:
  • Size: 32.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for YARW-0.1.5.tar.gz
Algorithm Hash digest
SHA256 3c6d2e904f7aa42c07ad544d8beb4401527eaf826a95555618cc99fe9f050294
MD5 313614d3444cc73b9392dc7f946f67c9
BLAKE2b-256 1ec6e9212a9ff8a938674c5465df7a97230bc2d4cf17f4ce1a662a523ca9b56d

See more details on using hashes here.

File details

Details for the file YARW-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: YARW-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for YARW-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 dd898684198c09fa273a43e11c6fdae5a5560495fb236121e95336ab25bf0aee
MD5 6cceb843ae0ab0a4b7ed99e84cca2e6b
BLAKE2b-256 e669503a4d600d89ad9730aa1750b8d405f30dccf8293df1f757e5f1e8c273f9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page