Skip to content

Commit 6a871d8

Browse files
committed
new feature: app compatibility flags
1 parent 6e5c3d4 commit 6a871d8

22 files changed

Lines changed: 974 additions & 279 deletions

main.pyw

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from functools import wraps
22
from os import path
33
from traceback import format_exc
4-
from typing import Callable, ParamSpec, TypeVar
4+
from typing import Callable, Literal, ParamSpec, TypeVar
55

66
import webview
77

@@ -34,16 +34,25 @@ class Api:
3434
return get_display_info()
3535

3636
@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+
):
3845
from py.utils import write_registry_value
3946

40-
write_registry_value(path, name, type, value)
47+
write_registry_value(hkey_str, path, name, type, value)
4148

4249
@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+
):
4453
from py.utils import delete_registry_value
4554

46-
delete_registry_value(path, value)
55+
delete_registry_value(hkey_str, path, value)
4756

4857
@handle_api_errors
4958
def deleteRegistryKey(self, path: str, key: str):
@@ -102,6 +111,12 @@ class Api:
102111

103112
set_active_scheme(scheme_guid_str)
104113

114+
@handle_api_errors
115+
def getCompatibilityOptions(self):
116+
from py.COMPATIBILITY_OPTIONS import get_compatibility_options
117+
118+
return get_compatibility_options()
119+
105120

106121
def on_shown(window): # type: ignore
107122
window.maximize() # type: ignore

0 commit comments

Comments
 (0)