|
1 | 1 | from functools import wraps |
2 | 2 | from os import path |
3 | 3 | from traceback import format_exc |
4 | | -from typing import Callable, ParamSpec, TypeVar |
| 4 | +from typing import Callable, Literal, ParamSpec, TypeVar |
5 | 5 |
|
6 | 6 | import webview |
7 | 7 |
|
@@ -34,16 +34,25 @@ class Api: |
34 | 34 | return get_display_info() |
35 | 35 |
|
36 | 36 | @handle_api_errors |
37 | | - def writeRegistryValue(self, path: str, name: str, type: int, value: int | str): |
| 37 | + def writeRegistryValue( |
| 38 | + self, |
| 39 | + hkey_str: Literal["HKLM", "HKCU"], |
| 40 | + path: str, |
| 41 | + name: str, |
| 42 | + type: int, |
| 43 | + value: int | str, |
| 44 | + ): |
38 | 45 | from py.utils import write_registry_value |
39 | 46 |
|
40 | | - write_registry_value(path, name, type, value) |
| 47 | + write_registry_value(hkey_str, path, name, type, value) |
41 | 48 |
|
42 | 49 | @handle_api_errors |
43 | | - def deleteRegistryValue(self, path: str, value: str): |
| 50 | + def deleteRegistryValue( |
| 51 | + self, hkey_str: Literal["HKLM", "HKCU"], path: str, value: str |
| 52 | + ): |
44 | 53 | from py.utils import delete_registry_value |
45 | 54 |
|
46 | | - delete_registry_value(path, value) |
| 55 | + delete_registry_value(hkey_str, path, value) |
47 | 56 |
|
48 | 57 | @handle_api_errors |
49 | 58 | def deleteRegistryKey(self, path: str, key: str): |
@@ -102,6 +111,12 @@ class Api: |
102 | 111 |
|
103 | 112 | set_active_scheme(scheme_guid_str) |
104 | 113 |
|
| 114 | + @handle_api_errors |
| 115 | + def getCompatibilityOptions(self): |
| 116 | + from py.COMPATIBILITY_OPTIONS import get_compatibility_options |
| 117 | + |
| 118 | + return get_compatibility_options() |
| 119 | + |
105 | 120 |
|
106 | 121 | def on_shown(window): # type: ignore |
107 | 122 | window.maximize() # type: ignore |
|
0 commit comments