winrt-Windows.System.Power.Diagnostics 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 (18) hide show
  1. {winrt_windows_system_power_diagnostics-2.0.1 → winrt_windows_system_power_diagnostics-2.2.0}/PKG-INFO +3 -3
  2. {winrt_windows_system_power_diagnostics-2.0.1 → winrt_windows_system_power_diagnostics-2.2.0}/py.Windows.System.Power.Diagnostics.cpp +102 -66
  3. {winrt_windows_system_power_diagnostics-2.0.1 → winrt_windows_system_power_diagnostics-2.2.0}/pyproject.toml +3 -2
  4. winrt_windows_system_power_diagnostics-2.2.0/pywinrt-version.txt +1 -0
  5. {winrt_windows_system_power_diagnostics-2.0.1 → winrt_windows_system_power_diagnostics-2.2.0}/requirements.txt +2 -2
  6. {winrt_windows_system_power_diagnostics-2.0.1 → winrt_windows_system_power_diagnostics-2.2.0}/winrt/_winrt_windows_system_power_diagnostics.pyi +3 -5
  7. {winrt_windows_system_power_diagnostics-2.0.1 → winrt_windows_system_power_diagnostics-2.2.0}/winrt/windows/system/power/diagnostics/__init__.py +1 -1
  8. {winrt_windows_system_power_diagnostics-2.0.1 → winrt_windows_system_power_diagnostics-2.2.0}/winrt_Windows.System.Power.Diagnostics.egg-info/PKG-INFO +3 -3
  9. winrt_windows_system_power_diagnostics-2.2.0/winrt_Windows.System.Power.Diagnostics.egg-info/requires.txt +1 -0
  10. winrt_windows_system_power_diagnostics-2.0.1/pywinrt-version.txt +0 -1
  11. winrt_windows_system_power_diagnostics-2.0.1/winrt_Windows.System.Power.Diagnostics.egg-info/requires.txt +0 -1
  12. {winrt_windows_system_power_diagnostics-2.0.1 → winrt_windows_system_power_diagnostics-2.2.0}/README.md +0 -0
  13. {winrt_windows_system_power_diagnostics-2.0.1 → winrt_windows_system_power_diagnostics-2.2.0}/setup.cfg +0 -0
  14. {winrt_windows_system_power_diagnostics-2.0.1 → winrt_windows_system_power_diagnostics-2.2.0}/setup.py +0 -0
  15. {winrt_windows_system_power_diagnostics-2.0.1 → winrt_windows_system_power_diagnostics-2.2.0}/winrt/windows/system/power/diagnostics/py.typed +0 -0
  16. {winrt_windows_system_power_diagnostics-2.0.1 → winrt_windows_system_power_diagnostics-2.2.0}/winrt_Windows.System.Power.Diagnostics.egg-info/SOURCES.txt +0 -0
  17. {winrt_windows_system_power_diagnostics-2.0.1 → winrt_windows_system_power_diagnostics-2.2.0}/winrt_Windows.System.Power.Diagnostics.egg-info/dependency_links.txt +0 -0
  18. {winrt_windows_system_power_diagnostics-2.0.1 → winrt_windows_system_power_diagnostics-2.2.0}/winrt_Windows.System.Power.Diagnostics.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: winrt-Windows.System.Power.Diagnostics
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,9 +10,9 @@ 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
 
17
17
  <!-- warning: Please don't edit this file. It was automatically generated. -->
18
18
 
@@ -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.System.Power.Diagnostics.h"
4
4
 
5
-
6
5
  namespace py::cpp::Windows::System::Power::Diagnostics
7
6
  {
8
7
  // ----- BackgroundEnergyDiagnostics class --------------------
@@ -20,14 +19,21 @@ namespace py::cpp::Windows::System::Power::Diagnostics
20
19
 
21
20
  if (arg_count == 0)
22
21
  {
23
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.System.Power.Diagnostics.BackgroundEnergyDiagnostics", L"ComputeTotalEnergyUsage", 0))
24
- {
25
- py::set_arg_count_version_error(0);
26
- return nullptr;
27
- }
28
-
29
22
  try
30
23
  {
24
+ static std::optional<bool> is_overload_present{};
25
+
26
+ if (!is_overload_present.has_value())
27
+ {
28
+ is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.System.Power.Diagnostics.BackgroundEnergyDiagnostics", L"ComputeTotalEnergyUsage", 0);
29
+ }
30
+
31
+ if (!is_overload_present.value())
32
+ {
33
+ py::set_arg_count_version_error(0);
34
+ return nullptr;
35
+ }
36
+
31
37
  return py::convert(winrt::Windows::System::Power::Diagnostics::BackgroundEnergyDiagnostics::ComputeTotalEnergyUsage());
32
38
  }
33
39
  catch (...)
@@ -49,14 +55,21 @@ namespace py::cpp::Windows::System::Power::Diagnostics
49
55
 
50
56
  if (arg_count == 0)
51
57
  {
52
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.System.Power.Diagnostics.BackgroundEnergyDiagnostics", L"ResetTotalEnergyUsage", 0))
53
- {
54
- py::set_arg_count_version_error(0);
55
- return nullptr;
56
- }
57
-
58
58
  try
59
59
  {
60
+ static std::optional<bool> is_overload_present{};
61
+
62
+ if (!is_overload_present.has_value())
63
+ {
64
+ is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.System.Power.Diagnostics.BackgroundEnergyDiagnostics", L"ResetTotalEnergyUsage", 0);
65
+ }
66
+
67
+ if (!is_overload_present.value())
68
+ {
69
+ py::set_arg_count_version_error(0);
70
+ return nullptr;
71
+ }
72
+
60
73
  winrt::Windows::System::Power::Diagnostics::BackgroundEnergyDiagnostics::ResetTotalEnergyUsage();
61
74
  Py_RETURN_NONE;
62
75
  }
@@ -75,14 +88,21 @@ namespace py::cpp::Windows::System::Power::Diagnostics
75
88
 
76
89
  static PyObject* BackgroundEnergyDiagnostics_get_DeviceSpecificConversionFactor(PyObject* /*unused*/, void* /*unused*/) noexcept
77
90
  {
78
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Power.Diagnostics.BackgroundEnergyDiagnostics", L"DeviceSpecificConversionFactor"))
79
- {
80
- PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
81
- return nullptr;
82
- }
83
-
84
91
  try
85
92
  {
93
+ static std::optional<bool> is_property_present{};
94
+
95
+ if (!is_property_present.has_value())
96
+ {
97
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Power.Diagnostics.BackgroundEnergyDiagnostics", L"DeviceSpecificConversionFactor");
98
+ }
99
+
100
+ if (!is_property_present.value())
101
+ {
102
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
103
+ return nullptr;
104
+ }
105
+
86
106
  return py::convert(winrt::Windows::System::Power::Diagnostics::BackgroundEnergyDiagnostics::DeviceSpecificConversionFactor());
87
107
  }
88
108
  catch (...)
@@ -100,22 +120,19 @@ namespace py::cpp::Windows::System::Power::Diagnostics
100
120
  { }
101
121
  };
102
122
 
103
- static PyType_Slot _type_slots_BackgroundEnergyDiagnostics[] =
104
- {
123
+ static PyType_Slot _type_slots_BackgroundEnergyDiagnostics[] = {
105
124
  { Py_tp_new, reinterpret_cast<void*>(_new_BackgroundEnergyDiagnostics) },
106
125
  { Py_tp_methods, reinterpret_cast<void*>(_methods_BackgroundEnergyDiagnostics) },
107
126
  { Py_tp_getset, reinterpret_cast<void*>(_getset_BackgroundEnergyDiagnostics) },
108
- { },
127
+ { }
109
128
  };
110
129
 
111
- static PyType_Spec type_spec_BackgroundEnergyDiagnostics =
112
- {
130
+ static PyType_Spec type_spec_BackgroundEnergyDiagnostics = {
113
131
  "winrt._winrt_windows_system_power_diagnostics.BackgroundEnergyDiagnostics",
114
132
  0,
115
133
  0,
116
134
  Py_TPFLAGS_DEFAULT,
117
- _type_slots_BackgroundEnergyDiagnostics
118
- };
135
+ _type_slots_BackgroundEnergyDiagnostics};
119
136
 
120
137
  static PyGetSetDef getset_BackgroundEnergyDiagnostics_Static[] = {
121
138
  { "device_specific_conversion_factor", reinterpret_cast<getter>(BackgroundEnergyDiagnostics_get_DeviceSpecificConversionFactor), nullptr, nullptr, nullptr },
@@ -160,14 +177,21 @@ namespace py::cpp::Windows::System::Power::Diagnostics
160
177
 
161
178
  if (arg_count == 0)
162
179
  {
163
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.System.Power.Diagnostics.ForegroundEnergyDiagnostics", L"ComputeTotalEnergyUsage", 0))
164
- {
165
- py::set_arg_count_version_error(0);
166
- return nullptr;
167
- }
168
-
169
180
  try
170
181
  {
182
+ static std::optional<bool> is_overload_present{};
183
+
184
+ if (!is_overload_present.has_value())
185
+ {
186
+ is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.System.Power.Diagnostics.ForegroundEnergyDiagnostics", L"ComputeTotalEnergyUsage", 0);
187
+ }
188
+
189
+ if (!is_overload_present.value())
190
+ {
191
+ py::set_arg_count_version_error(0);
192
+ return nullptr;
193
+ }
194
+
171
195
  return py::convert(winrt::Windows::System::Power::Diagnostics::ForegroundEnergyDiagnostics::ComputeTotalEnergyUsage());
172
196
  }
173
197
  catch (...)
@@ -189,14 +213,21 @@ namespace py::cpp::Windows::System::Power::Diagnostics
189
213
 
190
214
  if (arg_count == 0)
191
215
  {
192
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.System.Power.Diagnostics.ForegroundEnergyDiagnostics", L"ResetTotalEnergyUsage", 0))
193
- {
194
- py::set_arg_count_version_error(0);
195
- return nullptr;
196
- }
197
-
198
216
  try
199
217
  {
218
+ static std::optional<bool> is_overload_present{};
219
+
220
+ if (!is_overload_present.has_value())
221
+ {
222
+ is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.System.Power.Diagnostics.ForegroundEnergyDiagnostics", L"ResetTotalEnergyUsage", 0);
223
+ }
224
+
225
+ if (!is_overload_present.value())
226
+ {
227
+ py::set_arg_count_version_error(0);
228
+ return nullptr;
229
+ }
230
+
200
231
  winrt::Windows::System::Power::Diagnostics::ForegroundEnergyDiagnostics::ResetTotalEnergyUsage();
201
232
  Py_RETURN_NONE;
202
233
  }
@@ -215,14 +246,21 @@ namespace py::cpp::Windows::System::Power::Diagnostics
215
246
 
216
247
  static PyObject* ForegroundEnergyDiagnostics_get_DeviceSpecificConversionFactor(PyObject* /*unused*/, void* /*unused*/) noexcept
217
248
  {
218
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Power.Diagnostics.ForegroundEnergyDiagnostics", L"DeviceSpecificConversionFactor"))
219
- {
220
- PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
221
- return nullptr;
222
- }
223
-
224
249
  try
225
250
  {
251
+ static std::optional<bool> is_property_present{};
252
+
253
+ if (!is_property_present.has_value())
254
+ {
255
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.System.Power.Diagnostics.ForegroundEnergyDiagnostics", L"DeviceSpecificConversionFactor");
256
+ }
257
+
258
+ if (!is_property_present.value())
259
+ {
260
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
261
+ return nullptr;
262
+ }
263
+
226
264
  return py::convert(winrt::Windows::System::Power::Diagnostics::ForegroundEnergyDiagnostics::DeviceSpecificConversionFactor());
227
265
  }
228
266
  catch (...)
@@ -240,22 +278,19 @@ namespace py::cpp::Windows::System::Power::Diagnostics
240
278
  { }
241
279
  };
242
280
 
243
- static PyType_Slot _type_slots_ForegroundEnergyDiagnostics[] =
244
- {
281
+ static PyType_Slot _type_slots_ForegroundEnergyDiagnostics[] = {
245
282
  { Py_tp_new, reinterpret_cast<void*>(_new_ForegroundEnergyDiagnostics) },
246
283
  { Py_tp_methods, reinterpret_cast<void*>(_methods_ForegroundEnergyDiagnostics) },
247
284
  { Py_tp_getset, reinterpret_cast<void*>(_getset_ForegroundEnergyDiagnostics) },
248
- { },
285
+ { }
249
286
  };
250
287
 
251
- static PyType_Spec type_spec_ForegroundEnergyDiagnostics =
252
- {
288
+ static PyType_Spec type_spec_ForegroundEnergyDiagnostics = {
253
289
  "winrt._winrt_windows_system_power_diagnostics.ForegroundEnergyDiagnostics",
254
290
  0,
255
291
  0,
256
292
  Py_TPFLAGS_DEFAULT,
257
- _type_slots_ForegroundEnergyDiagnostics
258
- };
293
+ _type_slots_ForegroundEnergyDiagnostics};
259
294
 
260
295
  static PyGetSetDef getset_ForegroundEnergyDiagnostics_Static[] = {
261
296
  { "device_specific_conversion_factor", reinterpret_cast<getter>(ForegroundEnergyDiagnostics_get_DeviceSpecificConversionFactor), nullptr, nullptr, nullptr },
@@ -286,20 +321,19 @@ namespace py::cpp::Windows::System::Power::Diagnostics
286
321
  };
287
322
 
288
323
  // ----- Windows.System.Power.Diagnostics Initialization --------------------
289
- PyDoc_STRVAR(module_doc, "Windows::System::Power::Diagnostics");
290
-
291
324
 
292
- static PyModuleDef module_def
293
- = {PyModuleDef_HEAD_INIT,
294
- "_winrt_windows_system_power_diagnostics",
295
- module_doc,
296
- 0,
297
- nullptr,
298
- nullptr,
299
- nullptr,
300
- nullptr,
301
- nullptr};
325
+ PyDoc_STRVAR(module_doc, "Windows.System.Power.Diagnostics");
302
326
 
327
+ static PyModuleDef module_def = {
328
+ PyModuleDef_HEAD_INIT,
329
+ "_winrt_windows_system_power_diagnostics",
330
+ module_doc,
331
+ 0,
332
+ nullptr,
333
+ nullptr,
334
+ nullptr,
335
+ nullptr,
336
+ nullptr};
303
337
  } // py::cpp::Windows::System::Power::Diagnostics
304
338
 
305
339
  PyMODINIT_FUNC PyInit__winrt_windows_system_power_diagnostics(void) noexcept
@@ -337,7 +371,8 @@ PyMODINIT_FUNC PyInit__winrt_windows_system_power_diagnostics(void) noexcept
337
371
  return nullptr;
338
372
  }
339
373
 
340
- if (py::register_python_type(module.get(), &type_spec_BackgroundEnergyDiagnostics, object_bases.get(), reinterpret_cast<PyTypeObject*>(type_BackgroundEnergyDiagnostics_Static.get())) == -1)
374
+ py::pytype_handle BackgroundEnergyDiagnostics_type{py::register_python_type(module.get(), &type_spec_BackgroundEnergyDiagnostics, object_bases.get(), reinterpret_cast<PyTypeObject*>(type_BackgroundEnergyDiagnostics_Static.get()))};
375
+ if (!BackgroundEnergyDiagnostics_type)
341
376
  {
342
377
  return nullptr;
343
378
  }
@@ -348,7 +383,8 @@ PyMODINIT_FUNC PyInit__winrt_windows_system_power_diagnostics(void) noexcept
348
383
  return nullptr;
349
384
  }
350
385
 
351
- if (py::register_python_type(module.get(), &type_spec_ForegroundEnergyDiagnostics, object_bases.get(), reinterpret_cast<PyTypeObject*>(type_ForegroundEnergyDiagnostics_Static.get())) == -1)
386
+ py::pytype_handle ForegroundEnergyDiagnostics_type{py::register_python_type(module.get(), &type_spec_ForegroundEnergyDiagnostics, object_bases.get(), reinterpret_cast<PyTypeObject*>(type_ForegroundEnergyDiagnostics_Static.get()))};
387
+ if (!ForegroundEnergyDiagnostics_type)
352
388
  {
353
389
  return nullptr;
354
390
  }
@@ -16,7 +16,7 @@ classifiers = [
16
16
  "Intended Audience :: Developers",
17
17
  ]
18
18
  dynamic = ["version", "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"
@@ -35,7 +35,8 @@ dependencies = { file = "requirements.txt" }
35
35
  # use local winrt-sdk build dependency
36
36
  environment = { PYTHONPATH="../winrt-sdk/src" }
37
37
  # don't install winrt-sdk from PyPI
38
- build-frontend = { name = "build", args = ["--skip-dependency-check", "--no-isolation"] }
38
+ build-frontend = { name = "build[uv]", args = ["--skip-dependency-check", "--no-isolation"] }
39
+ before-build = "uv pip install setuptools"
39
40
  # don't build for PyPy
40
41
  skip = "pp*"
41
42
  # 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
@@ -21,8 +21,7 @@ class BackgroundEnergyDiagnostics_Static(type):
21
21
 
22
22
  @typing.final
23
23
  class BackgroundEnergyDiagnostics(winrt.system.Object, metaclass=BackgroundEnergyDiagnostics_Static):
24
- @staticmethod
25
- def _from(obj: winrt.system.Object, /) -> BackgroundEnergyDiagnostics: ...
24
+ pass
26
25
 
27
26
  @typing.final
28
27
  class ForegroundEnergyDiagnostics_Static(type):
@@ -33,6 +32,5 @@ class ForegroundEnergyDiagnostics_Static(type):
33
32
 
34
33
  @typing.final
35
34
  class ForegroundEnergyDiagnostics(winrt.system.Object, metaclass=ForegroundEnergyDiagnostics_Static):
36
- @staticmethod
37
- def _from(obj: winrt.system.Object, /) -> ForegroundEnergyDiagnostics: ...
35
+ pass
38
36
 
@@ -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 winrt.system
4
4
  from winrt import _winrt_windows_system_power_diagnostics
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: winrt-Windows.System.Power.Diagnostics
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,9 +10,9 @@ 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
 
17
17
  <!-- warning: Please don't edit this file. It was automatically generated. -->
18
18