winrt-Windows.Devices.Custom 2.0.1__tar.gz → 2.2.0__tar.gz

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.
Files changed (20) hide show
  1. {winrt_windows_devices_custom-2.0.1 → winrt_windows_devices_custom-2.2.0}/PKG-INFO +5 -5
  2. winrt_windows_devices_custom-2.2.0/all-requirements.txt +4 -0
  3. {winrt_windows_devices_custom-2.0.1 → winrt_windows_devices_custom-2.2.0}/py.Windows.Devices.Custom.cpp +258 -149
  4. {winrt_windows_devices_custom-2.0.1 → winrt_windows_devices_custom-2.2.0}/pyproject.toml +3 -2
  5. winrt_windows_devices_custom-2.2.0/pywinrt-version.txt +1 -0
  6. {winrt_windows_devices_custom-2.0.1 → winrt_windows_devices_custom-2.2.0}/requirements.txt +2 -2
  7. {winrt_windows_devices_custom-2.0.1 → winrt_windows_devices_custom-2.2.0}/winrt/_winrt_windows_devices_custom.pyi +10 -11
  8. {winrt_windows_devices_custom-2.0.1 → winrt_windows_devices_custom-2.2.0}/winrt/windows/devices/custom/__init__.py +1 -1
  9. {winrt_windows_devices_custom-2.0.1 → winrt_windows_devices_custom-2.2.0}/winrt_Windows.Devices.Custom.egg-info/PKG-INFO +5 -5
  10. winrt_windows_devices_custom-2.2.0/winrt_Windows.Devices.Custom.egg-info/requires.txt +5 -0
  11. winrt_windows_devices_custom-2.0.1/all-requirements.txt +0 -4
  12. winrt_windows_devices_custom-2.0.1/pywinrt-version.txt +0 -1
  13. winrt_windows_devices_custom-2.0.1/winrt_Windows.Devices.Custom.egg-info/requires.txt +0 -5
  14. {winrt_windows_devices_custom-2.0.1 → winrt_windows_devices_custom-2.2.0}/README.md +0 -0
  15. {winrt_windows_devices_custom-2.0.1 → winrt_windows_devices_custom-2.2.0}/setup.cfg +0 -0
  16. {winrt_windows_devices_custom-2.0.1 → winrt_windows_devices_custom-2.2.0}/setup.py +0 -0
  17. {winrt_windows_devices_custom-2.0.1 → winrt_windows_devices_custom-2.2.0}/winrt/windows/devices/custom/py.typed +0 -0
  18. {winrt_windows_devices_custom-2.0.1 → winrt_windows_devices_custom-2.2.0}/winrt_Windows.Devices.Custom.egg-info/SOURCES.txt +0 -0
  19. {winrt_windows_devices_custom-2.0.1 → winrt_windows_devices_custom-2.2.0}/winrt_Windows.Devices.Custom.egg-info/dependency_links.txt +0 -0
  20. {winrt_windows_devices_custom-2.0.1 → winrt_windows_devices_custom-2.2.0}/winrt_Windows.Devices.Custom.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: winrt-Windows.Devices.Custom
3
- Version: 2.0.1
3
+ Version: 2.2.0
4
4
  Summary: Python projection of Windows Runtime (WinRT) APIs
5
5
  License: MIT
6
6
  Project-URL: Documentation, https://pywinrt.readthedocs.io
@@ -10,12 +10,12 @@ Classifier: Operating System :: Microsoft :: Windows
10
10
  Classifier: Programming Language :: Python :: 3
11
11
  Classifier: Programming Language :: Python :: Implementation :: CPython
12
12
  Classifier: Intended Audience :: Developers
13
- Requires-Python: <3.13,>=3.9
13
+ Requires-Python: <3.14,>=3.9
14
14
  Description-Content-Type: text/markdown
15
- Requires-Dist: winrt-runtime==2.0.1
15
+ Requires-Dist: winrt-runtime==2.2.0
16
16
  Provides-Extra: all
17
- Requires-Dist: winrt-Windows.Foundation[all]==2.0.1; extra == "all"
18
- Requires-Dist: winrt-Windows.Storage.Streams[all]==2.0.1; extra == "all"
17
+ Requires-Dist: winrt-Windows.Foundation[all]==2.2.0; extra == "all"
18
+ Requires-Dist: winrt-Windows.Storage.Streams[all]==2.2.0; extra == "all"
19
19
 
20
20
  <!-- warning: Please don't edit this file. It was automatically generated. -->
21
21
 
@@ -0,0 +1,4 @@
1
+ # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.2.0
2
+
3
+ winrt-Windows.Foundation[all]==2.2.0
4
+ winrt-Windows.Storage.Streams[all]==2.2.0
@@ -1,8 +1,7 @@
1
- // WARNING: Please don't edit this file. It was generated by Python/WinRT v2.0.1
1
+ // WARNING: Please don't edit this file. It was generated by Python/WinRT v2.2.0
2
2
 
3
3
  #include "py.Windows.Devices.Custom.h"
4
4
 
5
-
6
5
  namespace py::cpp::Windows::Devices::Custom
7
6
  {
8
7
  // ----- CustomDevice class --------------------
@@ -28,14 +27,21 @@ namespace py::cpp::Windows::Devices::Custom
28
27
 
29
28
  if (arg_count == 3)
30
29
  {
31
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Devices.Custom.CustomDevice", L"FromIdAsync", 3))
32
- {
33
- py::set_arg_count_version_error(3);
34
- return nullptr;
35
- }
36
-
37
30
  try
38
31
  {
32
+ static std::optional<bool> is_overload_present{};
33
+
34
+ if (!is_overload_present.has_value())
35
+ {
36
+ is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Devices.Custom.CustomDevice", L"FromIdAsync", 3);
37
+ }
38
+
39
+ if (!is_overload_present.value())
40
+ {
41
+ py::set_arg_count_version_error(3);
42
+ return nullptr;
43
+ }
44
+
39
45
  auto param0 = py::convert_to<winrt::hstring>(args, 0);
40
46
  auto param1 = py::convert_to<winrt::Windows::Devices::Custom::DeviceAccessMode>(args, 1);
41
47
  auto param2 = py::convert_to<winrt::Windows::Devices::Custom::DeviceSharingMode>(args, 2);
@@ -61,14 +67,21 @@ namespace py::cpp::Windows::Devices::Custom
61
67
 
62
68
  if (arg_count == 1)
63
69
  {
64
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Devices.Custom.CustomDevice", L"GetDeviceSelector", 1))
65
- {
66
- py::set_arg_count_version_error(1);
67
- return nullptr;
68
- }
69
-
70
70
  try
71
71
  {
72
+ static std::optional<bool> is_overload_present{};
73
+
74
+ if (!is_overload_present.has_value())
75
+ {
76
+ is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Devices.Custom.CustomDevice", L"GetDeviceSelector", 1);
77
+ }
78
+
79
+ if (!is_overload_present.value())
80
+ {
81
+ py::set_arg_count_version_error(1);
82
+ return nullptr;
83
+ }
84
+
72
85
  auto param0 = py::convert_to<winrt::guid>(args, 0);
73
86
 
74
87
  return py::convert(winrt::Windows::Devices::Custom::CustomDevice::GetDeviceSelector(param0));
@@ -92,14 +105,21 @@ namespace py::cpp::Windows::Devices::Custom
92
105
 
93
106
  if (arg_count == 3)
94
107
  {
95
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Devices.Custom.CustomDevice", L"SendIOControlAsync", 3))
96
- {
97
- py::set_arg_count_version_error(3);
98
- return nullptr;
99
- }
100
-
101
108
  try
102
109
  {
110
+ static std::optional<bool> is_overload_present{};
111
+
112
+ if (!is_overload_present.has_value())
113
+ {
114
+ is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Devices.Custom.CustomDevice", L"SendIOControlAsync", 3);
115
+ }
116
+
117
+ if (!is_overload_present.value())
118
+ {
119
+ py::set_arg_count_version_error(3);
120
+ return nullptr;
121
+ }
122
+
103
123
  auto param0 = py::convert_to<winrt::Windows::Devices::Custom::IIOControlCode>(args, 0);
104
124
  auto param1 = py::convert_to<winrt::Windows::Storage::Streams::IBuffer>(args, 1);
105
125
  auto param2 = py::convert_to<winrt::Windows::Storage::Streams::IBuffer>(args, 2);
@@ -125,14 +145,21 @@ namespace py::cpp::Windows::Devices::Custom
125
145
 
126
146
  if (arg_count == 3)
127
147
  {
128
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Devices.Custom.CustomDevice", L"TrySendIOControlAsync", 3))
129
- {
130
- py::set_arg_count_version_error(3);
131
- return nullptr;
132
- }
133
-
134
148
  try
135
149
  {
150
+ static std::optional<bool> is_overload_present{};
151
+
152
+ if (!is_overload_present.has_value())
153
+ {
154
+ is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Devices.Custom.CustomDevice", L"TrySendIOControlAsync", 3);
155
+ }
156
+
157
+ if (!is_overload_present.value())
158
+ {
159
+ py::set_arg_count_version_error(3);
160
+ return nullptr;
161
+ }
162
+
136
163
  auto param0 = py::convert_to<winrt::Windows::Devices::Custom::IIOControlCode>(args, 0);
137
164
  auto param1 = py::convert_to<winrt::Windows::Storage::Streams::IBuffer>(args, 1);
138
165
  auto param2 = py::convert_to<winrt::Windows::Storage::Streams::IBuffer>(args, 2);
@@ -154,14 +181,21 @@ namespace py::cpp::Windows::Devices::Custom
154
181
 
155
182
  static PyObject* CustomDevice_get_InputStream(py::wrapper::Windows::Devices::Custom::CustomDevice* self, void* /*unused*/) noexcept
156
183
  {
157
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.CustomDevice", L"InputStream"))
158
- {
159
- PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
160
- return nullptr;
161
- }
162
-
163
184
  try
164
185
  {
186
+ static std::optional<bool> is_property_present{};
187
+
188
+ if (!is_property_present.has_value())
189
+ {
190
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.CustomDevice", L"InputStream");
191
+ }
192
+
193
+ if (!is_property_present.value())
194
+ {
195
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
196
+ return nullptr;
197
+ }
198
+
165
199
  return py::convert(self->obj.InputStream());
166
200
  }
167
201
  catch (...)
@@ -173,14 +207,21 @@ namespace py::cpp::Windows::Devices::Custom
173
207
 
174
208
  static PyObject* CustomDevice_get_OutputStream(py::wrapper::Windows::Devices::Custom::CustomDevice* self, void* /*unused*/) noexcept
175
209
  {
176
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.CustomDevice", L"OutputStream"))
177
- {
178
- PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
179
- return nullptr;
180
- }
181
-
182
210
  try
183
211
  {
212
+ static std::optional<bool> is_property_present{};
213
+
214
+ if (!is_property_present.has_value())
215
+ {
216
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.CustomDevice", L"OutputStream");
217
+ }
218
+
219
+ if (!is_property_present.value())
220
+ {
221
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
222
+ return nullptr;
223
+ }
224
+
184
225
  return py::convert(self->obj.OutputStream());
185
226
  }
186
227
  catch (...)
@@ -228,23 +269,20 @@ namespace py::cpp::Windows::Devices::Custom
228
269
  { }
229
270
  };
230
271
 
231
- static PyType_Slot _type_slots_CustomDevice[] =
232
- {
272
+ static PyType_Slot _type_slots_CustomDevice[] = {
233
273
  { Py_tp_new, reinterpret_cast<void*>(_new_CustomDevice) },
234
274
  { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_CustomDevice) },
235
275
  { Py_tp_methods, reinterpret_cast<void*>(_methods_CustomDevice) },
236
276
  { Py_tp_getset, reinterpret_cast<void*>(_getset_CustomDevice) },
237
- { },
277
+ { }
238
278
  };
239
279
 
240
- static PyType_Spec type_spec_CustomDevice =
241
- {
280
+ static PyType_Spec type_spec_CustomDevice = {
242
281
  "winrt._winrt_windows_devices_custom.CustomDevice",
243
282
  sizeof(py::wrapper::Windows::Devices::Custom::CustomDevice),
244
283
  0,
245
284
  Py_TPFLAGS_DEFAULT,
246
- _type_slots_CustomDevice
247
- };
285
+ _type_slots_CustomDevice};
248
286
 
249
287
  static PyGetSetDef getset_CustomDevice_Static[] = {
250
288
  { }
@@ -293,7 +331,7 @@ namespace py::cpp::Windows::Devices::Custom
293
331
  auto param2 = py::convert_to<winrt::Windows::Devices::Custom::IOControlAccessMode>(args, 2);
294
332
  auto param3 = py::convert_to<winrt::Windows::Devices::Custom::IOControlBufferingMethod>(args, 3);
295
333
 
296
- winrt::Windows::Devices::Custom::IOControlCode instance{ param0, param1, param2, param3 };
334
+ winrt::Windows::Devices::Custom::IOControlCode instance{param0, param1, param2, param3};
297
335
  return py::wrap(instance, type);
298
336
  }
299
337
  catch (...)
@@ -319,14 +357,21 @@ namespace py::cpp::Windows::Devices::Custom
319
357
 
320
358
  static PyObject* IOControlCode_get_AccessMode(py::wrapper::Windows::Devices::Custom::IOControlCode* self, void* /*unused*/) noexcept
321
359
  {
322
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.IOControlCode", L"AccessMode"))
323
- {
324
- PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
325
- return nullptr;
326
- }
327
-
328
360
  try
329
361
  {
362
+ static std::optional<bool> is_property_present{};
363
+
364
+ if (!is_property_present.has_value())
365
+ {
366
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.IOControlCode", L"AccessMode");
367
+ }
368
+
369
+ if (!is_property_present.value())
370
+ {
371
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
372
+ return nullptr;
373
+ }
374
+
330
375
  return py::convert(self->obj.AccessMode());
331
376
  }
332
377
  catch (...)
@@ -338,14 +383,21 @@ namespace py::cpp::Windows::Devices::Custom
338
383
 
339
384
  static PyObject* IOControlCode_get_BufferingMethod(py::wrapper::Windows::Devices::Custom::IOControlCode* self, void* /*unused*/) noexcept
340
385
  {
341
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.IOControlCode", L"BufferingMethod"))
342
- {
343
- PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
344
- return nullptr;
345
- }
346
-
347
386
  try
348
387
  {
388
+ static std::optional<bool> is_property_present{};
389
+
390
+ if (!is_property_present.has_value())
391
+ {
392
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.IOControlCode", L"BufferingMethod");
393
+ }
394
+
395
+ if (!is_property_present.value())
396
+ {
397
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
398
+ return nullptr;
399
+ }
400
+
349
401
  return py::convert(self->obj.BufferingMethod());
350
402
  }
351
403
  catch (...)
@@ -357,14 +409,21 @@ namespace py::cpp::Windows::Devices::Custom
357
409
 
358
410
  static PyObject* IOControlCode_get_ControlCode(py::wrapper::Windows::Devices::Custom::IOControlCode* self, void* /*unused*/) noexcept
359
411
  {
360
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.IOControlCode", L"ControlCode"))
361
- {
362
- PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
363
- return nullptr;
364
- }
365
-
366
412
  try
367
413
  {
414
+ static std::optional<bool> is_property_present{};
415
+
416
+ if (!is_property_present.has_value())
417
+ {
418
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.IOControlCode", L"ControlCode");
419
+ }
420
+
421
+ if (!is_property_present.value())
422
+ {
423
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
424
+ return nullptr;
425
+ }
426
+
368
427
  return py::convert(self->obj.ControlCode());
369
428
  }
370
429
  catch (...)
@@ -376,14 +435,21 @@ namespace py::cpp::Windows::Devices::Custom
376
435
 
377
436
  static PyObject* IOControlCode_get_DeviceType(py::wrapper::Windows::Devices::Custom::IOControlCode* self, void* /*unused*/) noexcept
378
437
  {
379
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.IOControlCode", L"DeviceType"))
380
- {
381
- PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
382
- return nullptr;
383
- }
384
-
385
438
  try
386
439
  {
440
+ static std::optional<bool> is_property_present{};
441
+
442
+ if (!is_property_present.has_value())
443
+ {
444
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.IOControlCode", L"DeviceType");
445
+ }
446
+
447
+ if (!is_property_present.value())
448
+ {
449
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
450
+ return nullptr;
451
+ }
452
+
387
453
  return py::convert(self->obj.DeviceType());
388
454
  }
389
455
  catch (...)
@@ -395,14 +461,21 @@ namespace py::cpp::Windows::Devices::Custom
395
461
 
396
462
  static PyObject* IOControlCode_get_Function(py::wrapper::Windows::Devices::Custom::IOControlCode* self, void* /*unused*/) noexcept
397
463
  {
398
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.IOControlCode", L"Function"))
399
- {
400
- PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
401
- return nullptr;
402
- }
403
-
404
464
  try
405
465
  {
466
+ static std::optional<bool> is_property_present{};
467
+
468
+ if (!is_property_present.has_value())
469
+ {
470
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.IOControlCode", L"Function");
471
+ }
472
+
473
+ if (!is_property_present.value())
474
+ {
475
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
476
+ return nullptr;
477
+ }
478
+
406
479
  return py::convert(self->obj.Function());
407
480
  }
408
481
  catch (...)
@@ -451,23 +524,20 @@ namespace py::cpp::Windows::Devices::Custom
451
524
  { }
452
525
  };
453
526
 
454
- static PyType_Slot _type_slots_IOControlCode[] =
455
- {
527
+ static PyType_Slot _type_slots_IOControlCode[] = {
456
528
  { Py_tp_new, reinterpret_cast<void*>(_new_IOControlCode) },
457
529
  { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_IOControlCode) },
458
530
  { Py_tp_methods, reinterpret_cast<void*>(_methods_IOControlCode) },
459
531
  { Py_tp_getset, reinterpret_cast<void*>(_getset_IOControlCode) },
460
- { },
532
+ { }
461
533
  };
462
534
 
463
- static PyType_Spec type_spec_IOControlCode =
464
- {
535
+ static PyType_Spec type_spec_IOControlCode = {
465
536
  "winrt._winrt_windows_devices_custom.IOControlCode",
466
537
  sizeof(py::wrapper::Windows::Devices::Custom::IOControlCode),
467
538
  0,
468
539
  Py_TPFLAGS_DEFAULT,
469
- _type_slots_IOControlCode
470
- };
540
+ _type_slots_IOControlCode};
471
541
 
472
542
  // ----- KnownDeviceTypes class --------------------
473
543
 
@@ -480,14 +550,21 @@ namespace py::cpp::Windows::Devices::Custom
480
550
 
481
551
  static PyObject* KnownDeviceTypes_get_Unknown(PyObject* /*unused*/, void* /*unused*/) noexcept
482
552
  {
483
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.KnownDeviceTypes", L"Unknown"))
484
- {
485
- PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
486
- return nullptr;
487
- }
488
-
489
553
  try
490
554
  {
555
+ static std::optional<bool> is_property_present{};
556
+
557
+ if (!is_property_present.has_value())
558
+ {
559
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.KnownDeviceTypes", L"Unknown");
560
+ }
561
+
562
+ if (!is_property_present.value())
563
+ {
564
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
565
+ return nullptr;
566
+ }
567
+
491
568
  return py::convert(winrt::Windows::Devices::Custom::KnownDeviceTypes::Unknown());
492
569
  }
493
570
  catch (...)
@@ -505,22 +582,19 @@ namespace py::cpp::Windows::Devices::Custom
505
582
  { }
506
583
  };
507
584
 
508
- static PyType_Slot _type_slots_KnownDeviceTypes[] =
509
- {
585
+ static PyType_Slot _type_slots_KnownDeviceTypes[] = {
510
586
  { Py_tp_new, reinterpret_cast<void*>(_new_KnownDeviceTypes) },
511
587
  { Py_tp_methods, reinterpret_cast<void*>(_methods_KnownDeviceTypes) },
512
588
  { Py_tp_getset, reinterpret_cast<void*>(_getset_KnownDeviceTypes) },
513
- { },
589
+ { }
514
590
  };
515
591
 
516
- static PyType_Spec type_spec_KnownDeviceTypes =
517
- {
592
+ static PyType_Spec type_spec_KnownDeviceTypes = {
518
593
  "winrt._winrt_windows_devices_custom.KnownDeviceTypes",
519
594
  0,
520
595
  0,
521
596
  Py_TPFLAGS_DEFAULT,
522
- _type_slots_KnownDeviceTypes
523
- };
597
+ _type_slots_KnownDeviceTypes};
524
598
 
525
599
  static PyGetSetDef getset_KnownDeviceTypes_Static[] = {
526
600
  { "unknown", reinterpret_cast<getter>(KnownDeviceTypes_get_Unknown), nullptr, nullptr, nullptr },
@@ -567,14 +641,21 @@ namespace py::cpp::Windows::Devices::Custom
567
641
 
568
642
  static PyObject* IIOControlCode_get_AccessMode(py::wrapper::Windows::Devices::Custom::IIOControlCode* self, void* /*unused*/) noexcept
569
643
  {
570
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.IIOControlCode", L"AccessMode"))
571
- {
572
- PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
573
- return nullptr;
574
- }
575
-
576
644
  try
577
645
  {
646
+ static std::optional<bool> is_property_present{};
647
+
648
+ if (!is_property_present.has_value())
649
+ {
650
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.IIOControlCode", L"AccessMode");
651
+ }
652
+
653
+ if (!is_property_present.value())
654
+ {
655
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
656
+ return nullptr;
657
+ }
658
+
578
659
  return py::convert(self->obj.AccessMode());
579
660
  }
580
661
  catch (...)
@@ -586,14 +667,21 @@ namespace py::cpp::Windows::Devices::Custom
586
667
 
587
668
  static PyObject* IIOControlCode_get_BufferingMethod(py::wrapper::Windows::Devices::Custom::IIOControlCode* self, void* /*unused*/) noexcept
588
669
  {
589
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.IIOControlCode", L"BufferingMethod"))
590
- {
591
- PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
592
- return nullptr;
593
- }
594
-
595
670
  try
596
671
  {
672
+ static std::optional<bool> is_property_present{};
673
+
674
+ if (!is_property_present.has_value())
675
+ {
676
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.IIOControlCode", L"BufferingMethod");
677
+ }
678
+
679
+ if (!is_property_present.value())
680
+ {
681
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
682
+ return nullptr;
683
+ }
684
+
597
685
  return py::convert(self->obj.BufferingMethod());
598
686
  }
599
687
  catch (...)
@@ -605,14 +693,21 @@ namespace py::cpp::Windows::Devices::Custom
605
693
 
606
694
  static PyObject* IIOControlCode_get_ControlCode(py::wrapper::Windows::Devices::Custom::IIOControlCode* self, void* /*unused*/) noexcept
607
695
  {
608
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.IIOControlCode", L"ControlCode"))
609
- {
610
- PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
611
- return nullptr;
612
- }
613
-
614
696
  try
615
697
  {
698
+ static std::optional<bool> is_property_present{};
699
+
700
+ if (!is_property_present.has_value())
701
+ {
702
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.IIOControlCode", L"ControlCode");
703
+ }
704
+
705
+ if (!is_property_present.value())
706
+ {
707
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
708
+ return nullptr;
709
+ }
710
+
616
711
  return py::convert(self->obj.ControlCode());
617
712
  }
618
713
  catch (...)
@@ -624,14 +719,21 @@ namespace py::cpp::Windows::Devices::Custom
624
719
 
625
720
  static PyObject* IIOControlCode_get_DeviceType(py::wrapper::Windows::Devices::Custom::IIOControlCode* self, void* /*unused*/) noexcept
626
721
  {
627
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.IIOControlCode", L"DeviceType"))
628
- {
629
- PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
630
- return nullptr;
631
- }
632
-
633
722
  try
634
723
  {
724
+ static std::optional<bool> is_property_present{};
725
+
726
+ if (!is_property_present.has_value())
727
+ {
728
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.IIOControlCode", L"DeviceType");
729
+ }
730
+
731
+ if (!is_property_present.value())
732
+ {
733
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
734
+ return nullptr;
735
+ }
736
+
635
737
  return py::convert(self->obj.DeviceType());
636
738
  }
637
739
  catch (...)
@@ -643,14 +745,21 @@ namespace py::cpp::Windows::Devices::Custom
643
745
 
644
746
  static PyObject* IIOControlCode_get_Function(py::wrapper::Windows::Devices::Custom::IIOControlCode* self, void* /*unused*/) noexcept
645
747
  {
646
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.IIOControlCode", L"Function"))
647
- {
648
- PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
649
- return nullptr;
650
- }
651
-
652
748
  try
653
749
  {
750
+ static std::optional<bool> is_property_present{};
751
+
752
+ if (!is_property_present.has_value())
753
+ {
754
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.IIOControlCode", L"Function");
755
+ }
756
+
757
+ if (!is_property_present.value())
758
+ {
759
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
760
+ return nullptr;
761
+ }
762
+
654
763
  return py::convert(self->obj.Function());
655
764
  }
656
765
  catch (...)
@@ -699,39 +808,35 @@ namespace py::cpp::Windows::Devices::Custom
699
808
  { }
700
809
  };
701
810
 
702
- static PyType_Slot _type_slots_IIOControlCode[] =
703
- {
811
+ static PyType_Slot _type_slots_IIOControlCode[] = {
704
812
  { Py_tp_new, reinterpret_cast<void*>(_new_IIOControlCode) },
705
813
  { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_IIOControlCode) },
706
814
  { Py_tp_methods, reinterpret_cast<void*>(_methods_IIOControlCode) },
707
815
  { Py_tp_getset, reinterpret_cast<void*>(_getset_IIOControlCode) },
708
- { },
816
+ { }
709
817
  };
710
818
 
711
- static PyType_Spec type_spec_IIOControlCode =
712
- {
819
+ static PyType_Spec type_spec_IIOControlCode = {
713
820
  "winrt._winrt_windows_devices_custom.IIOControlCode",
714
821
  sizeof(py::wrapper::Windows::Devices::Custom::IIOControlCode),
715
822
  0,
716
823
  Py_TPFLAGS_DEFAULT,
717
- _type_slots_IIOControlCode
718
- };
824
+ _type_slots_IIOControlCode};
719
825
 
720
826
  // ----- Windows.Devices.Custom Initialization --------------------
721
- PyDoc_STRVAR(module_doc, "Windows::Devices::Custom");
722
-
723
827
 
724
- static PyModuleDef module_def
725
- = {PyModuleDef_HEAD_INIT,
726
- "_winrt_windows_devices_custom",
727
- module_doc,
728
- 0,
729
- nullptr,
730
- nullptr,
731
- nullptr,
732
- nullptr,
733
- nullptr};
828
+ PyDoc_STRVAR(module_doc, "Windows.Devices.Custom");
734
829
 
830
+ static PyModuleDef module_def = {
831
+ PyModuleDef_HEAD_INIT,
832
+ "_winrt_windows_devices_custom",
833
+ module_doc,
834
+ 0,
835
+ nullptr,
836
+ nullptr,
837
+ nullptr,
838
+ nullptr,
839
+ nullptr};
735
840
  } // py::cpp::Windows::Devices::Custom
736
841
 
737
842
  PyMODINIT_FUNC PyInit__winrt_windows_devices_custom(void) noexcept
@@ -769,12 +874,14 @@ PyMODINIT_FUNC PyInit__winrt_windows_devices_custom(void) noexcept
769
874
  return nullptr;
770
875
  }
771
876
 
772
- if (py::register_python_type(module.get(), &type_spec_CustomDevice, object_bases.get(), reinterpret_cast<PyTypeObject*>(type_CustomDevice_Static.get())) == -1)
877
+ py::pytype_handle CustomDevice_type{py::register_python_type(module.get(), &type_spec_CustomDevice, object_bases.get(), reinterpret_cast<PyTypeObject*>(type_CustomDevice_Static.get()))};
878
+ if (!CustomDevice_type)
773
879
  {
774
880
  return nullptr;
775
881
  }
776
882
 
777
- if (py::register_python_type(module.get(), &type_spec_IOControlCode, object_bases.get(), nullptr) == -1)
883
+ py::pytype_handle IOControlCode_type{py::register_python_type(module.get(), &type_spec_IOControlCode, object_bases.get(), nullptr)};
884
+ if (!IOControlCode_type)
778
885
  {
779
886
  return nullptr;
780
887
  }
@@ -785,12 +892,14 @@ PyMODINIT_FUNC PyInit__winrt_windows_devices_custom(void) noexcept
785
892
  return nullptr;
786
893
  }
787
894
 
788
- if (py::register_python_type(module.get(), &type_spec_KnownDeviceTypes, object_bases.get(), reinterpret_cast<PyTypeObject*>(type_KnownDeviceTypes_Static.get())) == -1)
895
+ py::pytype_handle KnownDeviceTypes_type{py::register_python_type(module.get(), &type_spec_KnownDeviceTypes, object_bases.get(), reinterpret_cast<PyTypeObject*>(type_KnownDeviceTypes_Static.get()))};
896
+ if (!KnownDeviceTypes_type)
789
897
  {
790
898
  return nullptr;
791
899
  }
792
900
 
793
- if (py::register_python_type(module.get(), &type_spec_IIOControlCode, object_bases.get(), nullptr) == -1)
901
+ py::pytype_handle IIOControlCode_type{py::register_python_type(module.get(), &type_spec_IIOControlCode, object_bases.get(), nullptr)};
902
+ if (!IIOControlCode_type)
794
903
  {
795
904
  return nullptr;
796
905
  }
@@ -16,7 +16,7 @@ classifiers = [
16
16
  "Intended Audience :: Developers",
17
17
  ]
18
18
  dynamic = ["version", "dependencies", "optional-dependencies"]
19
- requires-python = ">=3.9,<3.13"
19
+ requires-python = ">=3.9,<3.14"
20
20
 
21
21
  [project.urls]
22
22
  # Homepage = "https://github.com/pywinrt/pywinrt"
@@ -36,7 +36,8 @@ optional-dependencies.all = { file = "all-requirements.txt" }
36
36
  # use local winrt-sdk build dependency
37
37
  environment = { PYTHONPATH="../winrt-sdk/src" }
38
38
  # don't install winrt-sdk from PyPI
39
- build-frontend = { name = "build", args = ["--skip-dependency-check", "--no-isolation"] }
39
+ build-frontend = { name = "build[uv]", args = ["--skip-dependency-check", "--no-isolation"] }
40
+ before-build = "uv pip install setuptools"
40
41
  # don't build for PyPy
41
42
  skip = "pp*"
42
43
  # suppress warnings about ARM64 testing
@@ -1,3 +1,3 @@
1
- # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.0.1
1
+ # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.2.0
2
2
 
3
- winrt-runtime==2.0.1
3
+ winrt-runtime==2.2.0
@@ -1,4 +1,4 @@
1
- # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.0.1
1
+ # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.2.0
2
2
 
3
3
  import datetime
4
4
  import sys
@@ -9,8 +9,8 @@ from builtins import property as _property
9
9
 
10
10
  import winrt._winrt
11
11
  import winrt.system
12
- import winrt.windows.foundation
13
- import winrt.windows.storage.streams
12
+ import winrt.windows.foundation as windows_foundation
13
+ import winrt.windows.storage.streams as windows_storage_streams
14
14
 
15
15
  from winrt.windows.devices.custom import DeviceAccessMode, DeviceSharingMode, IOControlAccessMode, IOControlBufferingMethod
16
16
 
@@ -18,25 +18,25 @@ Self = typing.TypeVar('Self')
18
18
 
19
19
  @typing.final
20
20
  class CustomDevice_Static(type):
21
- def from_id_async(cls, device_id: str, desired_access: DeviceAccessMode, sharing_mode: DeviceSharingMode, /) -> winrt.windows.foundation.IAsyncOperation[CustomDevice]: ...
21
+ def from_id_async(cls, device_id: str, desired_access: DeviceAccessMode, sharing_mode: DeviceSharingMode, /) -> windows_foundation.IAsyncOperation[CustomDevice]: ...
22
22
  def get_device_selector(cls, class_guid: _uuid.UUID, /) -> str: ...
23
23
 
24
24
  @typing.final
25
25
  class CustomDevice(winrt.system.Object, metaclass=CustomDevice_Static):
26
26
  @staticmethod
27
27
  def _from(obj: winrt.system.Object, /) -> CustomDevice: ...
28
- def send_i_o_control_async(self, io_control_code: typing.Optional[IIOControlCode], input_buffer: typing.Optional[winrt.windows.storage.streams.IBuffer], output_buffer: typing.Optional[winrt.windows.storage.streams.IBuffer], /) -> winrt.windows.foundation.IAsyncOperation[winrt.system.UInt32]: ...
29
- def try_send_i_o_control_async(self, io_control_code: typing.Optional[IIOControlCode], input_buffer: typing.Optional[winrt.windows.storage.streams.IBuffer], output_buffer: typing.Optional[winrt.windows.storage.streams.IBuffer], /) -> winrt.windows.foundation.IAsyncOperation[bool]: ...
28
+ def send_i_o_control_async(self, io_control_code: typing.Optional[IIOControlCode], input_buffer: typing.Optional[windows_storage_streams.IBuffer], output_buffer: typing.Optional[windows_storage_streams.IBuffer], /) -> windows_foundation.IAsyncOperation[winrt.system.UInt32]: ...
29
+ def try_send_i_o_control_async(self, io_control_code: typing.Optional[IIOControlCode], input_buffer: typing.Optional[windows_storage_streams.IBuffer], output_buffer: typing.Optional[windows_storage_streams.IBuffer], /) -> windows_foundation.IAsyncOperation[bool]: ...
30
30
  @_property
31
- def input_stream(self) -> typing.Optional[winrt.windows.storage.streams.IInputStream]: ...
31
+ def input_stream(self) -> typing.Optional[windows_storage_streams.IInputStream]: ...
32
32
  @_property
33
- def output_stream(self) -> typing.Optional[winrt.windows.storage.streams.IOutputStream]: ...
33
+ def output_stream(self) -> typing.Optional[windows_storage_streams.IOutputStream]: ...
34
34
 
35
35
  @typing.final
36
36
  class IOControlCode(winrt.system.Object):
37
37
  @staticmethod
38
38
  def _from(obj: winrt.system.Object, /) -> IOControlCode: ...
39
- def __new__(cls: typing.Type[IOControlCode], device_type: winrt.system.UInt16, function: winrt.system.UInt16, access_mode: IOControlAccessMode, buffering_method: IOControlBufferingMethod) -> IOControlCode:...
39
+ def __new__(cls: typing.Type[IOControlCode], device_type: winrt.system.UInt16, function: winrt.system.UInt16, access_mode: IOControlAccessMode, buffering_method: IOControlBufferingMethod) -> IOControlCode: ...
40
40
  @_property
41
41
  def access_mode(self) -> IOControlAccessMode: ...
42
42
  @_property
@@ -55,8 +55,7 @@ class KnownDeviceTypes_Static(type):
55
55
 
56
56
  @typing.final
57
57
  class KnownDeviceTypes(winrt.system.Object, metaclass=KnownDeviceTypes_Static):
58
- @staticmethod
59
- def _from(obj: winrt.system.Object, /) -> KnownDeviceTypes: ...
58
+ pass
60
59
 
61
60
  @typing.final
62
61
  class IIOControlCode(winrt.system.Object):
@@ -1,4 +1,4 @@
1
- # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.0.1
1
+ # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.2.0
2
2
 
3
3
  import enum
4
4
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: winrt-Windows.Devices.Custom
3
- Version: 2.0.1
3
+ Version: 2.2.0
4
4
  Summary: Python projection of Windows Runtime (WinRT) APIs
5
5
  License: MIT
6
6
  Project-URL: Documentation, https://pywinrt.readthedocs.io
@@ -10,12 +10,12 @@ Classifier: Operating System :: Microsoft :: Windows
10
10
  Classifier: Programming Language :: Python :: 3
11
11
  Classifier: Programming Language :: Python :: Implementation :: CPython
12
12
  Classifier: Intended Audience :: Developers
13
- Requires-Python: <3.13,>=3.9
13
+ Requires-Python: <3.14,>=3.9
14
14
  Description-Content-Type: text/markdown
15
- Requires-Dist: winrt-runtime==2.0.1
15
+ Requires-Dist: winrt-runtime==2.2.0
16
16
  Provides-Extra: all
17
- Requires-Dist: winrt-Windows.Foundation[all]==2.0.1; extra == "all"
18
- Requires-Dist: winrt-Windows.Storage.Streams[all]==2.0.1; extra == "all"
17
+ Requires-Dist: winrt-Windows.Foundation[all]==2.2.0; extra == "all"
18
+ Requires-Dist: winrt-Windows.Storage.Streams[all]==2.2.0; extra == "all"
19
19
 
20
20
  <!-- warning: Please don't edit this file. It was automatically generated. -->
21
21
 
@@ -0,0 +1,5 @@
1
+ winrt-runtime==2.2.0
2
+
3
+ [all]
4
+ winrt-Windows.Foundation[all]==2.2.0
5
+ winrt-Windows.Storage.Streams[all]==2.2.0
@@ -1,4 +0,0 @@
1
- # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.0.1
2
-
3
- winrt-Windows.Foundation[all]==2.0.1
4
- winrt-Windows.Storage.Streams[all]==2.0.1
@@ -1 +0,0 @@
1
- 2.0.1
@@ -1,5 +0,0 @@
1
- winrt-runtime==2.0.1
2
-
3
- [all]
4
- winrt-Windows.Foundation[all]==2.0.1
5
- winrt-Windows.Storage.Streams[all]==2.0.1