winrt-runtime 2.2.0__cp313-cp313-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
winrt/_winrt.pyi ADDED
@@ -0,0 +1,142 @@
1
+ import array
2
+ import types
3
+ from typing import (
4
+ Any,
5
+ Generic,
6
+ ItemsView,
7
+ Iterable,
8
+ Iterator,
9
+ KeysView,
10
+ List,
11
+ SupportsIndex,
12
+ Tuple,
13
+ Type,
14
+ TypeVar,
15
+ Union,
16
+ ValuesView,
17
+ overload,
18
+ )
19
+ from uuid import UUID
20
+
21
+ MTA: int
22
+ STA: int
23
+
24
+ def init_apartment(apartment_type: int) -> None: ...
25
+ def uninit_apartment() -> None: ...
26
+ def initialize_with_window(obj: Object, hwnd: int) -> None: ...
27
+ def _add_dll_directory(path: str) -> int: ...
28
+ def _remove_dll_directory(cookie: int) -> None: ...
29
+
30
+ _Self = TypeVar("_Self")
31
+ _T = TypeVar("_T")
32
+ _T_co = TypeVar("_T_co", covariant=True) # Any type covariant containers.
33
+ _KT = TypeVar("_KT")
34
+ _VT = TypeVar("_VT")
35
+ _VT_co = TypeVar("_VT_co", covariant=True) # Value type covariant containers.
36
+
37
+ # these classes don't actually exist but are just used to simplify type checking
38
+
39
+ class Sequence(Generic[_T_co]):
40
+ # collections.abc.Sequence mixin methods
41
+ def index(self, value: Any, start: int = 0, stop: int = ...) -> int: ...
42
+ def count(self, value: Any) -> int: ...
43
+ def __reversed__(self) -> Iterator[_T_co]: ...
44
+
45
+ class MutableSequence(Sequence[_T]):
46
+ # alias for insert_at
47
+ def insert(self, index: SupportsIndex, value: _T) -> None: ...
48
+ # collections.abc.MutableSequence mixin methods
49
+ def extend(self, values: Iterable[_T]) -> None: ...
50
+ def reverse(self) -> None: ...
51
+ def pop(self, index: int = -1) -> _T: ...
52
+ def remove(self, value: _T) -> None: ...
53
+ def __iadd__(self: _Self, values: Iterable[_T]) -> _Self: ...
54
+
55
+ class Mapping(Generic[_KT, _VT_co]):
56
+ # collections.abc.Mapping mixin methods
57
+ @overload
58
+ def get(self, __key: _KT) -> _VT_co | None: ...
59
+ @overload
60
+ def get(self, __key: _KT, default: _VT_co | _T) -> _VT_co | _T: ...
61
+ def items(self) -> ItemsView[_KT, _VT_co]: ...
62
+ def keys(self) -> KeysView[_KT]: ...
63
+ def values(self) -> ValuesView[_VT_co]: ...
64
+ def __eq__(self, __other: object) -> bool: ...
65
+
66
+ class MutableMapping(Mapping[_KT, _VT]):
67
+ # collections.abc.MutableMapping mixin methods
68
+ @overload
69
+ def pop(self, __key: _KT) -> _VT: ...
70
+ @overload
71
+ def pop(self, __key: _KT, default: _VT) -> _VT: ...
72
+ @overload
73
+ def pop(self, __key: _KT, default: _T) -> _VT | _T: ...
74
+ def popitem(self) -> Tuple[_KT, _VT]: ...
75
+ @overload
76
+ def setdefault(
77
+ self: MutableMapping[_KT, _T | None], __key: _KT, __default: None = None
78
+ ) -> _T | None: ...
79
+ @overload
80
+ def setdefault(self, __key: _KT, __default: _VT) -> _VT: ...
81
+ @overload
82
+ def update(self, __m: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ...
83
+ @overload
84
+ def update(self, **kwargs: _VT) -> None: ...
85
+
86
+ # actual runtime classes
87
+
88
+ class Object:
89
+ @property
90
+ def _iids_(self) -> Array[UUID]: ...
91
+ @property
92
+ def _runtime_class_name_(self) -> str: ...
93
+
94
+ class Array(MutableSequence[_T]):
95
+ _winrt_element_type_name_: str
96
+ def __class_getitem__(cls, key: Any) -> types.GenericAlias: ...
97
+ @overload
98
+ def __init__(
99
+ self,
100
+ type: Union[Type[_T], str],
101
+ size: int,
102
+ ) -> None: ...
103
+ @overload
104
+ def __init__(
105
+ self,
106
+ type: Union[Type[_T], str],
107
+ initializer: memoryview,
108
+ ) -> None: ...
109
+ @overload
110
+ def __init__(self, type: str, initializer: array.array) -> None: ...
111
+ @overload
112
+ def __init__(
113
+ self,
114
+ type: Union[Type[_T], str],
115
+ initializer: Array[_T],
116
+ ) -> None: ...
117
+ @overload
118
+ def __init__(
119
+ self,
120
+ type: Union[Type[_T], str],
121
+ initializer: List[_T],
122
+ /,
123
+ ) -> None: ...
124
+ @overload
125
+ def __init__(
126
+ self,
127
+ __type: Union[Type[_T], str],
128
+ __initializer: Tuple[_T],
129
+ ) -> None: ...
130
+ def __len__(self) -> int: ...
131
+ @overload
132
+ def __getitem__(self, index: SupportsIndex) -> _T: ...
133
+ @overload
134
+ def __getitem__(self, index: slice) -> MutableSequence[_T]: ...
135
+ @overload
136
+ def __setitem__(self, index: SupportsIndex, value: _T) -> None: ...
137
+ @overload
138
+ def __setitem__(self, index: slice, value: Iterable[_T]) -> None: ...
139
+ @overload
140
+ def __delitem__(self, index: SupportsIndex) -> None: ...
141
+ @overload
142
+ def __delitem__(self, index: slice) -> None: ...
winrt/msvcp140.dll ADDED
Binary file
winrt/py.typed ADDED
File without changes
@@ -0,0 +1,193 @@
1
+ from collections.abc import Mapping, MutableMapping, MutableSequence, Sequence
2
+ from pathlib import Path
3
+ from typing import Annotated
4
+
5
+ from .. import _winrt
6
+
7
+
8
+ class _DllCookie:
9
+ def __init__(self, cookie: int) -> None:
10
+ self.cookie = cookie
11
+
12
+ def close(self):
13
+ if self.cookie:
14
+ _winrt._remove_dll_directory(self.cookie)
15
+ self.cookie = None
16
+
17
+ def __del__(self):
18
+ self.close()
19
+
20
+
21
+ def _register_dll_search_path(module_path) -> _DllCookie:
22
+ """
23
+ Register a module's directory as a DLL search path.
24
+
25
+ Args:
26
+ module_path: The path to a module file (i.e. ``__file__``)
27
+
28
+ Returns:
29
+ An cookie object that will remove the search path when closed.
30
+ """
31
+ return _DllCookie(
32
+ _winrt._add_dll_directory(str(Path(module_path).parent.resolve()))
33
+ )
34
+
35
+
36
+ # NB: The types implemented in C cannot inherit from abc.ABC since Python 3.12
37
+ # so we have to implement the protocols like this instead.
38
+ # https://github.com/python/cpython/issues/103968#issuecomment-1589928055
39
+
40
+
41
+ def _mixin_sequence(typ) -> None:
42
+ """
43
+ Adds missing Python mapping methods to types that implement IVectorView and
44
+ registers the type as a Sequence.
45
+ """
46
+ # mixin methods
47
+ if not hasattr(typ, "index"):
48
+ typ.index = Sequence.index
49
+
50
+ if not hasattr(typ, "count"):
51
+ typ.count = Sequence.count
52
+
53
+ if not hasattr(typ, "__contains__"):
54
+ typ.__contains__ = Sequence.__contains__
55
+
56
+ if not hasattr(typ, "__iter__"):
57
+ typ.__iter__ = Sequence.__iter__
58
+
59
+ if not hasattr(typ, "__reversed__"):
60
+ typ.__reversed__ = Sequence.__reversed__
61
+
62
+ Sequence.register(typ)
63
+
64
+
65
+ def _mixin_mutable_sequence(typ) -> None:
66
+ """
67
+ Adds missing Python mapping methods to types that implement IVector and
68
+ registers the type as a MutableSequence.
69
+ """
70
+ _mixin_sequence(typ)
71
+
72
+ if not hasattr(typ, "insert") and hasattr(typ, "insert_at"):
73
+
74
+ def insert(self, index: int, value: object) -> None:
75
+ """
76
+ Alias for ``insert_at`` for compatibility with Python Sequence protocol.
77
+ """
78
+ self.insert_at(index, value)
79
+
80
+ typ.insert = insert
81
+
82
+ # mixin methods
83
+ if not hasattr(typ, "append"):
84
+ typ.append = MutableSequence.append
85
+
86
+ if not hasattr(typ, "clear"):
87
+ typ.clear = MutableSequence.clear
88
+
89
+ if not hasattr(typ, "extend"):
90
+ typ.extend = MutableSequence.extend
91
+
92
+ if not hasattr(typ, "reverse"):
93
+ typ.reverse = MutableSequence.reverse
94
+
95
+ if not hasattr(typ, "pop"):
96
+ typ.pop = MutableSequence.pop
97
+
98
+ if not hasattr(typ, "remove"):
99
+ typ.remove = MutableSequence.remove
100
+
101
+ if not hasattr(typ, "__iadd__"):
102
+ typ.__iadd__ = MutableSequence.__iadd__
103
+
104
+ MutableSequence.register(typ)
105
+
106
+
107
+ def _mixin_mapping(typ) -> None:
108
+ """
109
+ Adds missing Python mapping methods to types that implement IMapView and
110
+ registers the type as a Mapping.
111
+ """
112
+ # mixin methods
113
+ if not hasattr(typ, "keys"):
114
+ typ.keys = Mapping.keys
115
+
116
+ if not hasattr(typ, "items"):
117
+ typ.items = Mapping.items
118
+
119
+ if not hasattr(typ, "values"):
120
+ typ.values = Mapping.values
121
+
122
+ if not hasattr(typ, "get"):
123
+ typ.get = Mapping.get
124
+
125
+ if not hasattr(typ, "__contains__"):
126
+ typ.__contains__ = Mapping.__contains__
127
+
128
+ if typ.__eq__ == object.__eq__:
129
+ typ.__eq__ = Mapping.__eq__
130
+
131
+ Mapping.register(typ)
132
+
133
+
134
+ def _mixin_mutable_mapping(typ) -> None:
135
+ """
136
+ Adds missing Python mapping methods to types that implement IMap and
137
+ registers the type as a MutableMapping.
138
+ """
139
+ _mixin_mapping(typ)
140
+
141
+ # mixin methods
142
+ if not hasattr(typ, "clear"):
143
+ typ.clear = MutableMapping.clear
144
+
145
+ if not hasattr(typ, "pop"):
146
+ typ.pop = MutableMapping.pop
147
+ # private-name-mangled attribute :-(
148
+ typ._MutableMapping__marker = MutableMapping._MutableMapping__marker # type: ignore
149
+
150
+ if not hasattr(typ, "popitem"):
151
+ typ.popitem = MutableMapping.popitem
152
+
153
+ if not hasattr(typ, "setdefault"):
154
+ typ.setdefault = MutableMapping.setdefault
155
+
156
+ if not hasattr(typ, "update"):
157
+ typ.update = MutableMapping.update
158
+
159
+ MutableMapping.register(typ)
160
+
161
+
162
+ # type aliases with struct format string annotation
163
+ Int8 = Annotated[int, "b"]
164
+ UInt8 = Annotated[int, "B"]
165
+ Int16 = Annotated[int, "h"]
166
+ UInt16 = Annotated[int, "H"]
167
+ Int32 = Annotated[int, "i"]
168
+ UInt32 = Annotated[int, "I"]
169
+ Int64 = Annotated[int, "q"]
170
+ UInt64 = Annotated[int, "Q"]
171
+ Single = Annotated[float, "f"]
172
+ Double = Annotated[float, "d"]
173
+ Char16 = Annotated[str, "u"]
174
+
175
+ Object = _winrt.Object
176
+ Array = _winrt.Array
177
+ _mixin_mutable_sequence(Array)
178
+
179
+ __all__ = [
180
+ "Int8",
181
+ "UInt8",
182
+ "Int16",
183
+ "UInt16",
184
+ "Int32",
185
+ "UInt32",
186
+ "Int64",
187
+ "UInt64",
188
+ "Single",
189
+ "Double",
190
+ "Char16",
191
+ "Object",
192
+ "Array",
193
+ ]
@@ -0,0 +1,19 @@
1
+ Metadata-Version: 2.1
2
+ Name: winrt-runtime
3
+ Version: 2.2.0
4
+ Summary: Python projection of Windows Runtime (WinRT) APIs
5
+ License: MIT
6
+ Project-URL: Documentation, https://pywinrt.readthedocs.io
7
+ Project-URL: Repository, https://github.com/pywinrt/pywinrt
8
+ Project-URL: Changelog, https://github.com/pywinrt/pywinrt/blob/main/CHANGELOG.md
9
+ Classifier: Operating System :: Microsoft :: Windows
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: Implementation :: CPython
12
+ Classifier: Intended Audience :: Developers
13
+ Requires-Python: <3.14,>=3.9
14
+ Description-Content-Type: text/markdown
15
+
16
+ # winrt-runtime
17
+
18
+ This package provides the PyWinRT runtime including the `winrt.system` module.
19
+
@@ -0,0 +1,9 @@
1
+ winrt/_winrt.cp313-win_amd64.pyd,sha256=zKetWB-FyuifsMC_DZl9yVMplo0HHghcJ2HEkPaoJSk,61952
2
+ winrt/_winrt.pyi,sha256=UifonvgkiEsucdOnRLoaF1Pp_FHsTiyFskAeFV02_qQ,4223
3
+ winrt/msvcp140.dll,sha256=4KIqWU4Uj6Vc7vPkmWm_p3ARqAEmegvXgFtoG1k8nQs,567328
4
+ winrt/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ winrt/system/__init__.py,sha256=1gEFHFT7ZreiH52rLaxyOtLFA16m5Zv_pbGpSnKfZhQ,4861
6
+ winrt_runtime-2.2.0.dist-info/METADATA,sha256=INdW3VuWFG_Z3OHauRNw7q1_B8enl2MmYteuECvFR3g,733
7
+ winrt_runtime-2.2.0.dist-info/WHEEL,sha256=CdxowNJ2RPRCxUxJWAQ4R_o8uA51cjotGywc47Ht6wA,101
8
+ winrt_runtime-2.2.0.dist-info/top_level.txt,sha256=BzwQb4dZRt0NxCXi10ARjWsox7Asmtf_lXrw_KR-D_E,6
9
+ winrt_runtime-2.2.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (73.0.0)
3
+ Root-Is-Purelib: false
4
+ Tag: cp313-cp313-win_amd64
5
+
@@ -0,0 +1 @@
1
+ winrt