winrt-Windows.Devices.Custom 2.0.0b2__tar.gz → 2.1.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 (21) hide show
  1. {winrt-Windows.Devices.Custom-2.0.0b2 → winrt_windows_devices_custom-2.1.0}/PKG-INFO +4 -1
  2. winrt_windows_devices_custom-2.1.0/all-requirements.txt +4 -0
  3. {winrt-Windows.Devices.Custom-2.0.0b2 → winrt_windows_devices_custom-2.1.0}/py.Windows.Devices.Custom.cpp +130 -144
  4. {winrt-Windows.Devices.Custom-2.0.0b2 → winrt_windows_devices_custom-2.1.0}/pyproject.toml +2 -2
  5. winrt_windows_devices_custom-2.1.0/pywinrt-version.txt +1 -0
  6. {winrt-Windows.Devices.Custom-2.0.0b2 → winrt_windows_devices_custom-2.1.0}/requirements.txt +2 -2
  7. winrt_windows_devices_custom-2.1.0/setup.py +31 -0
  8. {winrt-Windows.Devices.Custom-2.0.0b2 → winrt_windows_devices_custom-2.1.0}/winrt/_winrt_windows_devices_custom.pyi +10 -11
  9. {winrt-Windows.Devices.Custom-2.0.0b2 → winrt_windows_devices_custom-2.1.0}/winrt/windows/devices/custom/__init__.py +1 -1
  10. winrt_windows_devices_custom-2.1.0/winrt/windows/devices/custom/py.typed +0 -0
  11. {winrt-Windows.Devices.Custom-2.0.0b2 → winrt_windows_devices_custom-2.1.0}/winrt_Windows.Devices.Custom.egg-info/PKG-INFO +4 -1
  12. {winrt-Windows.Devices.Custom-2.0.0b2 → winrt_windows_devices_custom-2.1.0}/winrt_Windows.Devices.Custom.egg-info/SOURCES.txt +1 -0
  13. winrt_windows_devices_custom-2.1.0/winrt_Windows.Devices.Custom.egg-info/requires.txt +5 -0
  14. winrt-Windows.Devices.Custom-2.0.0b2/all-requirements.txt +0 -4
  15. winrt-Windows.Devices.Custom-2.0.0b2/pywinrt-version.txt +0 -1
  16. winrt-Windows.Devices.Custom-2.0.0b2/setup.py +0 -16
  17. winrt-Windows.Devices.Custom-2.0.0b2/winrt_Windows.Devices.Custom.egg-info/requires.txt +0 -5
  18. {winrt-Windows.Devices.Custom-2.0.0b2 → winrt_windows_devices_custom-2.1.0}/README.md +0 -0
  19. {winrt-Windows.Devices.Custom-2.0.0b2 → winrt_windows_devices_custom-2.1.0}/setup.cfg +0 -0
  20. {winrt-Windows.Devices.Custom-2.0.0b2 → winrt_windows_devices_custom-2.1.0}/winrt_Windows.Devices.Custom.egg-info/dependency_links.txt +0 -0
  21. {winrt-Windows.Devices.Custom-2.0.0b2 → winrt_windows_devices_custom-2.1.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.0b2
3
+ Version: 2.1.0
4
4
  Summary: Python projection of Windows Runtime (WinRT) APIs
5
5
  License: MIT
6
6
  Project-URL: Documentation, https://pywinrt.readthedocs.io
@@ -12,7 +12,10 @@ Classifier: Programming Language :: Python :: Implementation :: CPython
12
12
  Classifier: Intended Audience :: Developers
13
13
  Requires-Python: <3.13,>=3.9
14
14
  Description-Content-Type: text/markdown
15
+ Requires-Dist: winrt-runtime==2.1.0
15
16
  Provides-Extra: all
17
+ Requires-Dist: winrt-Windows.Foundation[all]==2.1.0; extra == "all"
18
+ Requires-Dist: winrt-Windows.Storage.Streams[all]==2.1.0; extra == "all"
16
19
 
17
20
  <!-- warning: Please don't edit this file. It was automatically generated. -->
18
21
 
@@ -0,0 +1,4 @@
1
+ # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.1.0
2
+
3
+ winrt-Windows.Foundation[all]==2.1.0
4
+ winrt-Windows.Storage.Streams[all]==2.1.0
@@ -1,8 +1,7 @@
1
- // WARNING: Please don't edit this file. It was generated by Python/WinRT v2.0.0-beta.2
1
+ // WARNING: Please don't edit this file. It was generated by Python/WinRT v2.1.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,14 @@ 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
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Devices.Custom.CustomDevice", L"FromIdAsync", 3))
33
+ {
34
+ py::set_arg_count_version_error(3);
35
+ return nullptr;
36
+ }
37
+
39
38
  auto param0 = py::convert_to<winrt::hstring>(args, 0);
40
39
  auto param1 = py::convert_to<winrt::Windows::Devices::Custom::DeviceAccessMode>(args, 1);
41
40
  auto param2 = py::convert_to<winrt::Windows::Devices::Custom::DeviceSharingMode>(args, 2);
@@ -61,14 +60,14 @@ namespace py::cpp::Windows::Devices::Custom
61
60
 
62
61
  if (arg_count == 1)
63
62
  {
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
63
  try
71
64
  {
65
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Devices.Custom.CustomDevice", L"GetDeviceSelector", 1))
66
+ {
67
+ py::set_arg_count_version_error(1);
68
+ return nullptr;
69
+ }
70
+
72
71
  auto param0 = py::convert_to<winrt::guid>(args, 0);
73
72
 
74
73
  return py::convert(winrt::Windows::Devices::Custom::CustomDevice::GetDeviceSelector(param0));
@@ -92,14 +91,14 @@ namespace py::cpp::Windows::Devices::Custom
92
91
 
93
92
  if (arg_count == 3)
94
93
  {
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
94
  try
102
95
  {
96
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Devices.Custom.CustomDevice", L"SendIOControlAsync", 3))
97
+ {
98
+ py::set_arg_count_version_error(3);
99
+ return nullptr;
100
+ }
101
+
103
102
  auto param0 = py::convert_to<winrt::Windows::Devices::Custom::IIOControlCode>(args, 0);
104
103
  auto param1 = py::convert_to<winrt::Windows::Storage::Streams::IBuffer>(args, 1);
105
104
  auto param2 = py::convert_to<winrt::Windows::Storage::Streams::IBuffer>(args, 2);
@@ -125,14 +124,14 @@ namespace py::cpp::Windows::Devices::Custom
125
124
 
126
125
  if (arg_count == 3)
127
126
  {
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
127
  try
135
128
  {
129
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Devices.Custom.CustomDevice", L"TrySendIOControlAsync", 3))
130
+ {
131
+ py::set_arg_count_version_error(3);
132
+ return nullptr;
133
+ }
134
+
136
135
  auto param0 = py::convert_to<winrt::Windows::Devices::Custom::IIOControlCode>(args, 0);
137
136
  auto param1 = py::convert_to<winrt::Windows::Storage::Streams::IBuffer>(args, 1);
138
137
  auto param2 = py::convert_to<winrt::Windows::Storage::Streams::IBuffer>(args, 2);
@@ -154,14 +153,14 @@ namespace py::cpp::Windows::Devices::Custom
154
153
 
155
154
  static PyObject* CustomDevice_get_InputStream(py::wrapper::Windows::Devices::Custom::CustomDevice* self, void* /*unused*/) noexcept
156
155
  {
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
156
  try
164
157
  {
158
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.CustomDevice", L"InputStream"))
159
+ {
160
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
161
+ return nullptr;
162
+ }
163
+
165
164
  return py::convert(self->obj.InputStream());
166
165
  }
167
166
  catch (...)
@@ -173,14 +172,14 @@ namespace py::cpp::Windows::Devices::Custom
173
172
 
174
173
  static PyObject* CustomDevice_get_OutputStream(py::wrapper::Windows::Devices::Custom::CustomDevice* self, void* /*unused*/) noexcept
175
174
  {
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
175
  try
183
176
  {
177
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.CustomDevice", L"OutputStream"))
178
+ {
179
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
180
+ return nullptr;
181
+ }
182
+
184
183
  return py::convert(self->obj.OutputStream());
185
184
  }
186
185
  catch (...)
@@ -228,23 +227,20 @@ namespace py::cpp::Windows::Devices::Custom
228
227
  { }
229
228
  };
230
229
 
231
- static PyType_Slot _type_slots_CustomDevice[] =
232
- {
230
+ static PyType_Slot _type_slots_CustomDevice[] = {
233
231
  { Py_tp_new, reinterpret_cast<void*>(_new_CustomDevice) },
234
232
  { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_CustomDevice) },
235
233
  { Py_tp_methods, reinterpret_cast<void*>(_methods_CustomDevice) },
236
234
  { Py_tp_getset, reinterpret_cast<void*>(_getset_CustomDevice) },
237
- { },
235
+ { }
238
236
  };
239
237
 
240
- static PyType_Spec type_spec_CustomDevice =
241
- {
238
+ static PyType_Spec type_spec_CustomDevice = {
242
239
  "winrt._winrt_windows_devices_custom.CustomDevice",
243
240
  sizeof(py::wrapper::Windows::Devices::Custom::CustomDevice),
244
241
  0,
245
242
  Py_TPFLAGS_DEFAULT,
246
- _type_slots_CustomDevice
247
- };
243
+ _type_slots_CustomDevice};
248
244
 
249
245
  static PyGetSetDef getset_CustomDevice_Static[] = {
250
246
  { }
@@ -319,14 +315,14 @@ namespace py::cpp::Windows::Devices::Custom
319
315
 
320
316
  static PyObject* IOControlCode_get_AccessMode(py::wrapper::Windows::Devices::Custom::IOControlCode* self, void* /*unused*/) noexcept
321
317
  {
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
318
  try
329
319
  {
320
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.IOControlCode", L"AccessMode"))
321
+ {
322
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
323
+ return nullptr;
324
+ }
325
+
330
326
  return py::convert(self->obj.AccessMode());
331
327
  }
332
328
  catch (...)
@@ -338,14 +334,14 @@ namespace py::cpp::Windows::Devices::Custom
338
334
 
339
335
  static PyObject* IOControlCode_get_BufferingMethod(py::wrapper::Windows::Devices::Custom::IOControlCode* self, void* /*unused*/) noexcept
340
336
  {
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
337
  try
348
338
  {
339
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.IOControlCode", L"BufferingMethod"))
340
+ {
341
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
342
+ return nullptr;
343
+ }
344
+
349
345
  return py::convert(self->obj.BufferingMethod());
350
346
  }
351
347
  catch (...)
@@ -357,14 +353,14 @@ namespace py::cpp::Windows::Devices::Custom
357
353
 
358
354
  static PyObject* IOControlCode_get_ControlCode(py::wrapper::Windows::Devices::Custom::IOControlCode* self, void* /*unused*/) noexcept
359
355
  {
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
356
  try
367
357
  {
358
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.IOControlCode", L"ControlCode"))
359
+ {
360
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
361
+ return nullptr;
362
+ }
363
+
368
364
  return py::convert(self->obj.ControlCode());
369
365
  }
370
366
  catch (...)
@@ -376,14 +372,14 @@ namespace py::cpp::Windows::Devices::Custom
376
372
 
377
373
  static PyObject* IOControlCode_get_DeviceType(py::wrapper::Windows::Devices::Custom::IOControlCode* self, void* /*unused*/) noexcept
378
374
  {
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
375
  try
386
376
  {
377
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.IOControlCode", L"DeviceType"))
378
+ {
379
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
380
+ return nullptr;
381
+ }
382
+
387
383
  return py::convert(self->obj.DeviceType());
388
384
  }
389
385
  catch (...)
@@ -395,14 +391,14 @@ namespace py::cpp::Windows::Devices::Custom
395
391
 
396
392
  static PyObject* IOControlCode_get_Function(py::wrapper::Windows::Devices::Custom::IOControlCode* self, void* /*unused*/) noexcept
397
393
  {
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
394
  try
405
395
  {
396
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.IOControlCode", L"Function"))
397
+ {
398
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
399
+ return nullptr;
400
+ }
401
+
406
402
  return py::convert(self->obj.Function());
407
403
  }
408
404
  catch (...)
@@ -451,23 +447,20 @@ namespace py::cpp::Windows::Devices::Custom
451
447
  { }
452
448
  };
453
449
 
454
- static PyType_Slot _type_slots_IOControlCode[] =
455
- {
450
+ static PyType_Slot _type_slots_IOControlCode[] = {
456
451
  { Py_tp_new, reinterpret_cast<void*>(_new_IOControlCode) },
457
452
  { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_IOControlCode) },
458
453
  { Py_tp_methods, reinterpret_cast<void*>(_methods_IOControlCode) },
459
454
  { Py_tp_getset, reinterpret_cast<void*>(_getset_IOControlCode) },
460
- { },
455
+ { }
461
456
  };
462
457
 
463
- static PyType_Spec type_spec_IOControlCode =
464
- {
458
+ static PyType_Spec type_spec_IOControlCode = {
465
459
  "winrt._winrt_windows_devices_custom.IOControlCode",
466
460
  sizeof(py::wrapper::Windows::Devices::Custom::IOControlCode),
467
461
  0,
468
462
  Py_TPFLAGS_DEFAULT,
469
- _type_slots_IOControlCode
470
- };
463
+ _type_slots_IOControlCode};
471
464
 
472
465
  // ----- KnownDeviceTypes class --------------------
473
466
 
@@ -480,14 +473,14 @@ namespace py::cpp::Windows::Devices::Custom
480
473
 
481
474
  static PyObject* KnownDeviceTypes_get_Unknown(PyObject* /*unused*/, void* /*unused*/) noexcept
482
475
  {
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
476
  try
490
477
  {
478
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.KnownDeviceTypes", L"Unknown"))
479
+ {
480
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
481
+ return nullptr;
482
+ }
483
+
491
484
  return py::convert(winrt::Windows::Devices::Custom::KnownDeviceTypes::Unknown());
492
485
  }
493
486
  catch (...)
@@ -505,22 +498,19 @@ namespace py::cpp::Windows::Devices::Custom
505
498
  { }
506
499
  };
507
500
 
508
- static PyType_Slot _type_slots_KnownDeviceTypes[] =
509
- {
501
+ static PyType_Slot _type_slots_KnownDeviceTypes[] = {
510
502
  { Py_tp_new, reinterpret_cast<void*>(_new_KnownDeviceTypes) },
511
503
  { Py_tp_methods, reinterpret_cast<void*>(_methods_KnownDeviceTypes) },
512
504
  { Py_tp_getset, reinterpret_cast<void*>(_getset_KnownDeviceTypes) },
513
- { },
505
+ { }
514
506
  };
515
507
 
516
- static PyType_Spec type_spec_KnownDeviceTypes =
517
- {
508
+ static PyType_Spec type_spec_KnownDeviceTypes = {
518
509
  "winrt._winrt_windows_devices_custom.KnownDeviceTypes",
519
510
  0,
520
511
  0,
521
512
  Py_TPFLAGS_DEFAULT,
522
- _type_slots_KnownDeviceTypes
523
- };
513
+ _type_slots_KnownDeviceTypes};
524
514
 
525
515
  static PyGetSetDef getset_KnownDeviceTypes_Static[] = {
526
516
  { "unknown", reinterpret_cast<getter>(KnownDeviceTypes_get_Unknown), nullptr, nullptr, nullptr },
@@ -567,14 +557,14 @@ namespace py::cpp::Windows::Devices::Custom
567
557
 
568
558
  static PyObject* IIOControlCode_get_AccessMode(py::wrapper::Windows::Devices::Custom::IIOControlCode* self, void* /*unused*/) noexcept
569
559
  {
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
560
  try
577
561
  {
562
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.IIOControlCode", L"AccessMode"))
563
+ {
564
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
565
+ return nullptr;
566
+ }
567
+
578
568
  return py::convert(self->obj.AccessMode());
579
569
  }
580
570
  catch (...)
@@ -586,14 +576,14 @@ namespace py::cpp::Windows::Devices::Custom
586
576
 
587
577
  static PyObject* IIOControlCode_get_BufferingMethod(py::wrapper::Windows::Devices::Custom::IIOControlCode* self, void* /*unused*/) noexcept
588
578
  {
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
579
  try
596
580
  {
581
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.IIOControlCode", L"BufferingMethod"))
582
+ {
583
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
584
+ return nullptr;
585
+ }
586
+
597
587
  return py::convert(self->obj.BufferingMethod());
598
588
  }
599
589
  catch (...)
@@ -605,14 +595,14 @@ namespace py::cpp::Windows::Devices::Custom
605
595
 
606
596
  static PyObject* IIOControlCode_get_ControlCode(py::wrapper::Windows::Devices::Custom::IIOControlCode* self, void* /*unused*/) noexcept
607
597
  {
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
598
  try
615
599
  {
600
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.IIOControlCode", L"ControlCode"))
601
+ {
602
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
603
+ return nullptr;
604
+ }
605
+
616
606
  return py::convert(self->obj.ControlCode());
617
607
  }
618
608
  catch (...)
@@ -624,14 +614,14 @@ namespace py::cpp::Windows::Devices::Custom
624
614
 
625
615
  static PyObject* IIOControlCode_get_DeviceType(py::wrapper::Windows::Devices::Custom::IIOControlCode* self, void* /*unused*/) noexcept
626
616
  {
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
617
  try
634
618
  {
619
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.IIOControlCode", L"DeviceType"))
620
+ {
621
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
622
+ return nullptr;
623
+ }
624
+
635
625
  return py::convert(self->obj.DeviceType());
636
626
  }
637
627
  catch (...)
@@ -643,14 +633,14 @@ namespace py::cpp::Windows::Devices::Custom
643
633
 
644
634
  static PyObject* IIOControlCode_get_Function(py::wrapper::Windows::Devices::Custom::IIOControlCode* self, void* /*unused*/) noexcept
645
635
  {
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
636
  try
653
637
  {
638
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.IIOControlCode", L"Function"))
639
+ {
640
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
641
+ return nullptr;
642
+ }
643
+
654
644
  return py::convert(self->obj.Function());
655
645
  }
656
646
  catch (...)
@@ -699,39 +689,35 @@ namespace py::cpp::Windows::Devices::Custom
699
689
  { }
700
690
  };
701
691
 
702
- static PyType_Slot _type_slots_IIOControlCode[] =
703
- {
692
+ static PyType_Slot _type_slots_IIOControlCode[] = {
704
693
  { Py_tp_new, reinterpret_cast<void*>(_new_IIOControlCode) },
705
694
  { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_IIOControlCode) },
706
695
  { Py_tp_methods, reinterpret_cast<void*>(_methods_IIOControlCode) },
707
696
  { Py_tp_getset, reinterpret_cast<void*>(_getset_IIOControlCode) },
708
- { },
697
+ { }
709
698
  };
710
699
 
711
- static PyType_Spec type_spec_IIOControlCode =
712
- {
700
+ static PyType_Spec type_spec_IIOControlCode = {
713
701
  "winrt._winrt_windows_devices_custom.IIOControlCode",
714
702
  sizeof(py::wrapper::Windows::Devices::Custom::IIOControlCode),
715
703
  0,
716
704
  Py_TPFLAGS_DEFAULT,
717
- _type_slots_IIOControlCode
718
- };
705
+ _type_slots_IIOControlCode};
719
706
 
720
707
  // ----- Windows.Devices.Custom Initialization --------------------
721
- PyDoc_STRVAR(module_doc, "Windows::Devices::Custom");
722
708
 
709
+ PyDoc_STRVAR(module_doc, "Windows.Devices.Custom");
723
710
 
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};
734
-
711
+ static PyModuleDef module_def = {
712
+ PyModuleDef_HEAD_INIT,
713
+ "_winrt_windows_devices_custom",
714
+ module_doc,
715
+ 0,
716
+ nullptr,
717
+ nullptr,
718
+ nullptr,
719
+ nullptr,
720
+ nullptr};
735
721
  } // py::cpp::Windows::Devices::Custom
736
722
 
737
723
  PyMODINIT_FUNC PyInit__winrt_windows_devices_custom(void) noexcept
@@ -1,7 +1,7 @@
1
1
  # WARNING: Please don't edit this file. It was automatically generated.
2
2
 
3
3
  [build-system]
4
- requires = ["setuptools", "setuptools-scm", "winrt-sdk"]
4
+ requires = ["setuptools", "winrt-sdk"]
5
5
  build-backend = "setuptools.build_meta"
6
6
 
7
7
  [project]
@@ -30,7 +30,7 @@ dependencies = { file = "requirements.txt" }
30
30
  optional-dependencies.all = { file = "all-requirements.txt" }
31
31
 
32
32
  [tool.setuptools.package-data]
33
- winrt = ["*.pyi"]
33
+ "*" = ["*.pyi", "py.typed"]
34
34
 
35
35
  [tool.cibuildwheel]
36
36
  # use local winrt-sdk build dependency
@@ -1,3 +1,3 @@
1
- # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.0.0-beta.2
1
+ # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.1.0
2
2
 
3
- winrt-runtime==2.0.0-beta.2
3
+ winrt-runtime==2.1.0
@@ -0,0 +1,31 @@
1
+ # WARNING: Please don't edit this file. It was automatically generated.
2
+
3
+ from setuptools import Extension, setup
4
+ from setuptools.command.build_ext import build_ext
5
+ from winrt_sdk import get_include_dirs
6
+
7
+
8
+ class build_ext_ex(build_ext):
9
+ def build_extension(self, ext):
10
+ if self.compiler.compiler_type == "msvc":
11
+ ext.extra_compile_args = ["/std:c++20", "/permissive-"]
12
+ elif self.compiler.compiler_type == "mingw32":
13
+ ext.extra_compile_args = ["-std=c++20", "-D_WIN32_WINNT=_WIN32_WINNT_WIN10"]
14
+ ext.extra_link_args = ["-loleaut32"]
15
+ else:
16
+ raise ValueError(f"Unsupported compiler: {self.compiler.compiler_type}")
17
+
18
+ build_ext.build_extension(self, ext)
19
+
20
+
21
+ setup(
22
+ cmdclass = {'build_ext': build_ext_ex},
23
+ ext_modules=[
24
+ Extension(
25
+ "winrt._winrt_windows_devices_custom",
26
+ sources=["py.Windows.Devices.Custom.cpp"],
27
+ include_dirs=get_include_dirs(),
28
+ libraries=["windowsapp"],
29
+ )
30
+ ],
31
+ )
@@ -1,4 +1,4 @@
1
- # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.0.0-beta.2
1
+ # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.1.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.0-beta.2
1
+ # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.1.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.0b2
3
+ Version: 2.1.0
4
4
  Summary: Python projection of Windows Runtime (WinRT) APIs
5
5
  License: MIT
6
6
  Project-URL: Documentation, https://pywinrt.readthedocs.io
@@ -12,7 +12,10 @@ Classifier: Programming Language :: Python :: Implementation :: CPython
12
12
  Classifier: Intended Audience :: Developers
13
13
  Requires-Python: <3.13,>=3.9
14
14
  Description-Content-Type: text/markdown
15
+ Requires-Dist: winrt-runtime==2.1.0
15
16
  Provides-Extra: all
17
+ Requires-Dist: winrt-Windows.Foundation[all]==2.1.0; extra == "all"
18
+ Requires-Dist: winrt-Windows.Storage.Streams[all]==2.1.0; extra == "all"
16
19
 
17
20
  <!-- warning: Please don't edit this file. It was automatically generated. -->
18
21
 
@@ -7,6 +7,7 @@ requirements.txt
7
7
  setup.py
8
8
  winrt/_winrt_windows_devices_custom.pyi
9
9
  winrt/windows/devices/custom/__init__.py
10
+ winrt/windows/devices/custom/py.typed
10
11
  winrt_Windows.Devices.Custom.egg-info/PKG-INFO
11
12
  winrt_Windows.Devices.Custom.egg-info/SOURCES.txt
12
13
  winrt_Windows.Devices.Custom.egg-info/dependency_links.txt
@@ -0,0 +1,5 @@
1
+ winrt-runtime==2.1.0
2
+
3
+ [all]
4
+ winrt-Windows.Foundation[all]==2.1.0
5
+ winrt-Windows.Storage.Streams[all]==2.1.0
@@ -1,4 +0,0 @@
1
- # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.0.0-beta.2
2
-
3
- winrt-Windows.Foundation[all]==2.0.0-beta.2
4
- winrt-Windows.Storage.Streams[all]==2.0.0-beta.2
@@ -1 +0,0 @@
1
- 2.0.0-beta.2
@@ -1,16 +0,0 @@
1
- # WARNING: Please don't edit this file. It was automatically generated.
2
-
3
- from setuptools import Extension, setup
4
- from winrt_sdk import get_include_dirs
5
-
6
- setup(
7
- ext_modules=[
8
- Extension(
9
- "winrt._winrt_windows_devices_custom",
10
- sources=["py.Windows.Devices.Custom.cpp"],
11
- include_dirs=get_include_dirs(),
12
- extra_compile_args=["/std:c++20", "/permissive-"],
13
- libraries=["windowsapp"],
14
- )
15
- ],
16
- )
@@ -1,5 +0,0 @@
1
- winrt-runtime==2.0.0-beta.2
2
-
3
- [all]
4
- winrt-Windows.Foundation[all]==2.0.0-beta.2
5
- winrt-Windows.Storage.Streams[all]==2.0.0-beta.2