Registry Path¶
RegistryPath ¶
RegistryPath(path: str)
Represents a registry location in Windows.
Provides a convenient interface for interacting with Windows Registry paths.
This class mimics the API of pathlib.Path, allowing intuitive manipulation of registry paths.
Source code in context_menu_toolkit/registry/registry_structs/registry_path.py
42 43 44 45 46 47 | |
top_level_key
property
¶
top_level_key: TopLevelKey
The top level key of the path.
Example
RegistryPath("HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*").top_level_key
# ["HKEY_LOCAL_MACHINE", "SOFTWARE", "Classes", "*"]
subkeys
property
¶
subkeys: str
The path without the top level key, i.e. the sub keys.
Example
RegistryPath("HKEY_CURRENT_USER\Software\classes\*").subkeys
# Software\classes\*
parts
property
¶
The path split into parts.
Example
RegistryPath("HKEY_CURRENT_USER\Software\classes\*").parts
# ["HKEY_CURRENT_USER", "Software", "classes", "*"]
read ¶
read() -> RegistryKey
Read key at self location, recursively.
Source code in context_menu_toolkit/registry/registry_structs/registry_path.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | |
read_values ¶
read_values() -> list[RegistryValue]
Read all values of the key at current location.
Source code in context_menu_toolkit/registry/registry_structs/registry_path.py
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | |
write ¶
write(key: RegistryKey) -> None
Add RegistryKey to current location.
Source code in context_menu_toolkit/registry/registry_structs/registry_path.py
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | |
write_value ¶
write_value(value: RegistryValue) -> None
Add value to current location.
Source code in context_menu_toolkit/registry/registry_structs/registry_path.py
151 152 153 154 155 156 157 158 159 | |