|
| 1 | +import sys |
1 | 2 | from types import TracebackType |
2 | 3 | from typing import Any, Tuple, Type, Union |
3 | 4 |
|
4 | | -_KeyType = Union[HKEYType, int] |
| 5 | +if sys.platform == "win32": |
| 6 | + _KeyType = Union[HKEYType, int] |
| 7 | + def CloseKey(__hkey: _KeyType) -> None: ... |
| 8 | + def ConnectRegistry(__computer_name: str | None, __key: _KeyType) -> HKEYType: ... |
| 9 | + def CreateKey(__key: _KeyType, __sub_key: str | None) -> HKEYType: ... |
| 10 | + def CreateKeyEx(key: _KeyType, sub_key: str | None, reserved: int = ..., access: int = ...) -> HKEYType: ... |
| 11 | + def DeleteKey(__key: _KeyType, __sub_key: str) -> None: ... |
| 12 | + def DeleteKeyEx(key: _KeyType, sub_key: str, access: int = ..., reserved: int = ...) -> None: ... |
| 13 | + def DeleteValue(__key: _KeyType, __value: str) -> None: ... |
| 14 | + def EnumKey(__key: _KeyType, __index: int) -> str: ... |
| 15 | + def EnumValue(__key: _KeyType, __index: int) -> Tuple[str, Any, int]: ... |
| 16 | + def ExpandEnvironmentStrings(__str: str) -> str: ... |
| 17 | + def FlushKey(__key: _KeyType) -> None: ... |
| 18 | + def LoadKey(__key: _KeyType, __sub_key: str, __file_name: str) -> None: ... |
| 19 | + def OpenKey(key: _KeyType, sub_key: str, reserved: int = ..., access: int = ...) -> HKEYType: ... |
| 20 | + def OpenKeyEx(key: _KeyType, sub_key: str, reserved: int = ..., access: int = ...) -> HKEYType: ... |
| 21 | + def QueryInfoKey(__key: _KeyType) -> Tuple[int, int, int]: ... |
| 22 | + def QueryValue(__key: _KeyType, __sub_key: str | None) -> str: ... |
| 23 | + def QueryValueEx(__key: _KeyType, __name: str) -> Tuple[Any, int]: ... |
| 24 | + def SaveKey(__key: _KeyType, __file_name: str) -> None: ... |
| 25 | + def SetValue(__key: _KeyType, __sub_key: str, __type: int, __value: str) -> None: ... |
| 26 | + def SetValueEx( |
| 27 | + __key: _KeyType, __value_name: str | None, __reserved: Any, __type: int, __value: str | int |
| 28 | + ) -> None: ... # reserved is ignored |
| 29 | + def DisableReflectionKey(__key: _KeyType) -> None: ... |
| 30 | + def EnableReflectionKey(__key: _KeyType) -> None: ... |
| 31 | + def QueryReflectionKey(__key: _KeyType) -> bool: ... |
| 32 | + HKEY_CLASSES_ROOT: int |
| 33 | + HKEY_CURRENT_USER: int |
| 34 | + HKEY_LOCAL_MACHINE: int |
| 35 | + HKEY_USERS: int |
| 36 | + HKEY_PERFORMANCE_DATA: int |
| 37 | + HKEY_CURRENT_CONFIG: int |
| 38 | + HKEY_DYN_DATA: int |
5 | 39 |
|
6 | | -def CloseKey(__hkey: _KeyType) -> None: ... |
7 | | -def ConnectRegistry(__computer_name: str | None, __key: _KeyType) -> HKEYType: ... |
8 | | -def CreateKey(__key: _KeyType, __sub_key: str | None) -> HKEYType: ... |
9 | | -def CreateKeyEx(key: _KeyType, sub_key: str | None, reserved: int = ..., access: int = ...) -> HKEYType: ... |
10 | | -def DeleteKey(__key: _KeyType, __sub_key: str) -> None: ... |
11 | | -def DeleteKeyEx(key: _KeyType, sub_key: str, access: int = ..., reserved: int = ...) -> None: ... |
12 | | -def DeleteValue(__key: _KeyType, __value: str) -> None: ... |
13 | | -def EnumKey(__key: _KeyType, __index: int) -> str: ... |
14 | | -def EnumValue(__key: _KeyType, __index: int) -> Tuple[str, Any, int]: ... |
15 | | -def ExpandEnvironmentStrings(__str: str) -> str: ... |
16 | | -def FlushKey(__key: _KeyType) -> None: ... |
17 | | -def LoadKey(__key: _KeyType, __sub_key: str, __file_name: str) -> None: ... |
18 | | -def OpenKey(key: _KeyType, sub_key: str, reserved: int = ..., access: int = ...) -> HKEYType: ... |
19 | | -def OpenKeyEx(key: _KeyType, sub_key: str, reserved: int = ..., access: int = ...) -> HKEYType: ... |
20 | | -def QueryInfoKey(__key: _KeyType) -> Tuple[int, int, int]: ... |
21 | | -def QueryValue(__key: _KeyType, __sub_key: str | None) -> str: ... |
22 | | -def QueryValueEx(__key: _KeyType, __name: str) -> Tuple[Any, int]: ... |
23 | | -def SaveKey(__key: _KeyType, __file_name: str) -> None: ... |
24 | | -def SetValue(__key: _KeyType, __sub_key: str, __type: int, __value: str) -> None: ... |
25 | | -def SetValueEx( |
26 | | - __key: _KeyType, __value_name: str | None, __reserved: Any, __type: int, __value: str | int |
27 | | -) -> None: ... # reserved is ignored |
28 | | -def DisableReflectionKey(__key: _KeyType) -> None: ... |
29 | | -def EnableReflectionKey(__key: _KeyType) -> None: ... |
30 | | -def QueryReflectionKey(__key: _KeyType) -> bool: ... |
| 40 | + KEY_ALL_ACCESS: int |
| 41 | + KEY_WRITE: int |
| 42 | + KEY_READ: int |
| 43 | + KEY_EXECUTE: int |
| 44 | + KEY_QUERY_VALUE: int |
| 45 | + KEY_SET_VALUE: int |
| 46 | + KEY_CREATE_SUB_KEY: int |
| 47 | + KEY_ENUMERATE_SUB_KEYS: int |
| 48 | + KEY_NOTIFY: int |
| 49 | + KEY_CREATE_LINK: int |
31 | 50 |
|
32 | | -HKEY_CLASSES_ROOT: int |
33 | | -HKEY_CURRENT_USER: int |
34 | | -HKEY_LOCAL_MACHINE: int |
35 | | -HKEY_USERS: int |
36 | | -HKEY_PERFORMANCE_DATA: int |
37 | | -HKEY_CURRENT_CONFIG: int |
38 | | -HKEY_DYN_DATA: int |
| 51 | + KEY_WOW64_64KEY: int |
| 52 | + KEY_WOW64_32KEY: int |
39 | 53 |
|
40 | | -KEY_ALL_ACCESS: int |
41 | | -KEY_WRITE: int |
42 | | -KEY_READ: int |
43 | | -KEY_EXECUTE: int |
44 | | -KEY_QUERY_VALUE: int |
45 | | -KEY_SET_VALUE: int |
46 | | -KEY_CREATE_SUB_KEY: int |
47 | | -KEY_ENUMERATE_SUB_KEYS: int |
48 | | -KEY_NOTIFY: int |
49 | | -KEY_CREATE_LINK: int |
| 54 | + REG_BINARY: int |
| 55 | + REG_DWORD: int |
| 56 | + REG_DWORD_LITTLE_ENDIAN: int |
| 57 | + REG_DWORD_BIG_ENDIAN: int |
| 58 | + REG_EXPAND_SZ: int |
| 59 | + REG_LINK: int |
| 60 | + REG_MULTI_SZ: int |
| 61 | + REG_NONE: int |
| 62 | + REG_RESOURCE_LIST: int |
| 63 | + REG_FULL_RESOURCE_DESCRIPTOR: int |
| 64 | + REG_RESOURCE_REQUIREMENTS_LIST: int |
| 65 | + REG_SZ: int |
50 | 66 |
|
51 | | -KEY_WOW64_64KEY: int |
52 | | -KEY_WOW64_32KEY: int |
| 67 | + REG_CREATED_NEW_KEY: int # undocumented |
| 68 | + REG_LEGAL_CHANGE_FILTER: int # undocumented |
| 69 | + REG_LEGAL_OPTION: int # undocumented |
| 70 | + REG_NOTIFY_CHANGE_ATTRIBUTES: int # undocumented |
| 71 | + REG_NOTIFY_CHANGE_LAST_SET: int # undocumented |
| 72 | + REG_NOTIFY_CHANGE_NAME: int # undocumented |
| 73 | + REG_NOTIFY_CHANGE_SECURITY: int # undocumented |
| 74 | + REG_NO_LAZY_FLUSH: int # undocumented |
| 75 | + REG_OPENED_EXISTING_KEY: int # undocumented |
| 76 | + REG_OPTION_BACKUP_RESTORE: int # undocumented |
| 77 | + REG_OPTION_CREATE_LINK: int # undocumented |
| 78 | + REG_OPTION_NON_VOLATILE: int # undocumented |
| 79 | + REG_OPTION_OPEN_LINK: int # undocumented |
| 80 | + REG_OPTION_RESERVED: int # undocumented |
| 81 | + REG_OPTION_VOLATILE: int # undocumented |
| 82 | + REG_REFRESH_HIVE: int # undocumented |
| 83 | + REG_WHOLE_HIVE_VOLATILE: int # undocumented |
53 | 84 |
|
54 | | -REG_BINARY: int |
55 | | -REG_DWORD: int |
56 | | -REG_DWORD_LITTLE_ENDIAN: int |
57 | | -REG_DWORD_BIG_ENDIAN: int |
58 | | -REG_EXPAND_SZ: int |
59 | | -REG_LINK: int |
60 | | -REG_MULTI_SZ: int |
61 | | -REG_NONE: int |
62 | | -REG_RESOURCE_LIST: int |
63 | | -REG_FULL_RESOURCE_DESCRIPTOR: int |
64 | | -REG_RESOURCE_REQUIREMENTS_LIST: int |
65 | | -REG_SZ: int |
| 85 | + error = OSError |
66 | 86 |
|
67 | | -REG_CREATED_NEW_KEY: int # undocumented |
68 | | -REG_LEGAL_CHANGE_FILTER: int # undocumented |
69 | | -REG_LEGAL_OPTION: int # undocumented |
70 | | -REG_NOTIFY_CHANGE_ATTRIBUTES: int # undocumented |
71 | | -REG_NOTIFY_CHANGE_LAST_SET: int # undocumented |
72 | | -REG_NOTIFY_CHANGE_NAME: int # undocumented |
73 | | -REG_NOTIFY_CHANGE_SECURITY: int # undocumented |
74 | | -REG_NO_LAZY_FLUSH: int # undocumented |
75 | | -REG_OPENED_EXISTING_KEY: int # undocumented |
76 | | -REG_OPTION_BACKUP_RESTORE: int # undocumented |
77 | | -REG_OPTION_CREATE_LINK: int # undocumented |
78 | | -REG_OPTION_NON_VOLATILE: int # undocumented |
79 | | -REG_OPTION_OPEN_LINK: int # undocumented |
80 | | -REG_OPTION_RESERVED: int # undocumented |
81 | | -REG_OPTION_VOLATILE: int # undocumented |
82 | | -REG_REFRESH_HIVE: int # undocumented |
83 | | -REG_WHOLE_HIVE_VOLATILE: int # undocumented |
84 | | - |
85 | | -error = OSError |
86 | | - |
87 | | -# Though this class has a __name__ of PyHKEY, it's exposed as HKEYType for some reason |
88 | | -class HKEYType: |
89 | | - def __bool__(self) -> bool: ... |
90 | | - def __int__(self) -> int: ... |
91 | | - def __enter__(self) -> HKEYType: ... |
92 | | - def __exit__( |
93 | | - self, exc_type: Type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None |
94 | | - ) -> bool | None: ... |
95 | | - def Close(self) -> None: ... |
96 | | - def Detach(self) -> int: ... |
| 87 | + # Though this class has a __name__ of PyHKEY, it's exposed as HKEYType for some reason |
| 88 | + class HKEYType: |
| 89 | + def __bool__(self) -> bool: ... |
| 90 | + def __int__(self) -> int: ... |
| 91 | + def __enter__(self) -> HKEYType: ... |
| 92 | + def __exit__( |
| 93 | + self, exc_type: Type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None |
| 94 | + ) -> bool | None: ... |
| 95 | + def Close(self) -> None: ... |
| 96 | + def Detach(self) -> int: ... |
0 commit comments