winrt-Windows.ApplicationModel.Background 2.2.0__tar.gz → 2.3.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_applicationmodel_background-2.2.0 → winrt_windows_applicationmodel_background-2.3.0}/PKG-INFO +20 -20
  2. winrt_windows_applicationmodel_background-2.3.0/all-requirements.txt +20 -0
  3. {winrt_windows_applicationmodel_background-2.2.0 → winrt_windows_applicationmodel_background-2.3.0}/py.Windows.ApplicationModel.Background.cpp +321 -2
  4. winrt_windows_applicationmodel_background-2.3.0/pywinrt-version.txt +1 -0
  5. {winrt_windows_applicationmodel_background-2.2.0 → winrt_windows_applicationmodel_background-2.3.0}/requirements.txt +2 -2
  6. {winrt_windows_applicationmodel_background-2.2.0 → winrt_windows_applicationmodel_background-2.3.0}/winrt/_winrt_windows_applicationmodel_background.pyi +26 -3
  7. {winrt_windows_applicationmodel_background-2.2.0 → winrt_windows_applicationmodel_background-2.3.0}/winrt/windows/applicationmodel/background/__init__.py +8 -1
  8. {winrt_windows_applicationmodel_background-2.2.0 → winrt_windows_applicationmodel_background-2.3.0}/winrt_Windows.ApplicationModel.Background.egg-info/PKG-INFO +20 -20
  9. winrt_windows_applicationmodel_background-2.3.0/winrt_Windows.ApplicationModel.Background.egg-info/requires.txt +21 -0
  10. winrt_windows_applicationmodel_background-2.2.0/all-requirements.txt +0 -20
  11. winrt_windows_applicationmodel_background-2.2.0/pywinrt-version.txt +0 -1
  12. winrt_windows_applicationmodel_background-2.2.0/winrt_Windows.ApplicationModel.Background.egg-info/requires.txt +0 -21
  13. {winrt_windows_applicationmodel_background-2.2.0 → winrt_windows_applicationmodel_background-2.3.0}/README.md +0 -0
  14. {winrt_windows_applicationmodel_background-2.2.0 → winrt_windows_applicationmodel_background-2.3.0}/pyproject.toml +0 -0
  15. {winrt_windows_applicationmodel_background-2.2.0 → winrt_windows_applicationmodel_background-2.3.0}/setup.cfg +0 -0
  16. {winrt_windows_applicationmodel_background-2.2.0 → winrt_windows_applicationmodel_background-2.3.0}/setup.py +0 -0
  17. {winrt_windows_applicationmodel_background-2.2.0 → winrt_windows_applicationmodel_background-2.3.0}/winrt/windows/applicationmodel/background/py.typed +0 -0
  18. {winrt_windows_applicationmodel_background-2.2.0 → winrt_windows_applicationmodel_background-2.3.0}/winrt_Windows.ApplicationModel.Background.egg-info/SOURCES.txt +0 -0
  19. {winrt_windows_applicationmodel_background-2.2.0 → winrt_windows_applicationmodel_background-2.3.0}/winrt_Windows.ApplicationModel.Background.egg-info/dependency_links.txt +0 -0
  20. {winrt_windows_applicationmodel_background-2.2.0 → winrt_windows_applicationmodel_background-2.3.0}/winrt_Windows.ApplicationModel.Background.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: winrt-Windows.ApplicationModel.Background
3
- Version: 2.2.0
3
+ Version: 2.3.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,26 +12,26 @@ Classifier: Programming Language :: Python :: Implementation :: CPython
12
12
  Classifier: Intended Audience :: Developers
13
13
  Requires-Python: <3.14,>=3.9
14
14
  Description-Content-Type: text/markdown
15
- Requires-Dist: winrt-runtime==2.2.0
15
+ Requires-Dist: winrt-runtime==2.3.0
16
16
  Provides-Extra: all
17
- Requires-Dist: winrt-Windows.ApplicationModel.Activation[all]==2.2.0; extra == "all"
18
- Requires-Dist: winrt-Windows.ApplicationModel.Calls.Background[all]==2.2.0; extra == "all"
19
- Requires-Dist: winrt-Windows.Devices.Bluetooth[all]==2.2.0; extra == "all"
20
- Requires-Dist: winrt-Windows.Devices.Bluetooth.Advertisement[all]==2.2.0; extra == "all"
21
- Requires-Dist: winrt-Windows.Devices.Bluetooth.Background[all]==2.2.0; extra == "all"
22
- Requires-Dist: winrt-Windows.Devices.Bluetooth.GenericAttributeProfile[all]==2.2.0; extra == "all"
23
- Requires-Dist: winrt-Windows.Devices.Geolocation[all]==2.2.0; extra == "all"
24
- Requires-Dist: winrt-Windows.Devices.Sensors[all]==2.2.0; extra == "all"
25
- Requires-Dist: winrt-Windows.Devices.SmartCards[all]==2.2.0; extra == "all"
26
- Requires-Dist: winrt-Windows.Devices.Sms[all]==2.2.0; extra == "all"
27
- Requires-Dist: winrt-Windows.Foundation[all]==2.2.0; extra == "all"
28
- Requires-Dist: winrt-Windows.Foundation.Collections[all]==2.2.0; extra == "all"
29
- Requires-Dist: winrt-Windows.Networking[all]==2.2.0; extra == "all"
30
- Requires-Dist: winrt-Windows.Networking.Sockets[all]==2.2.0; extra == "all"
31
- Requires-Dist: winrt-Windows.Storage[all]==2.2.0; extra == "all"
32
- Requires-Dist: winrt-Windows.Storage.Provider[all]==2.2.0; extra == "all"
33
- Requires-Dist: winrt-Windows.System[all]==2.2.0; extra == "all"
34
- Requires-Dist: winrt-Windows.UI.Notifications[all]==2.2.0; extra == "all"
17
+ Requires-Dist: winrt-Windows.ApplicationModel.Activation[all]==2.3.0; extra == "all"
18
+ Requires-Dist: winrt-Windows.ApplicationModel.Calls.Background[all]==2.3.0; extra == "all"
19
+ Requires-Dist: winrt-Windows.Devices.Bluetooth[all]==2.3.0; extra == "all"
20
+ Requires-Dist: winrt-Windows.Devices.Bluetooth.Advertisement[all]==2.3.0; extra == "all"
21
+ Requires-Dist: winrt-Windows.Devices.Bluetooth.Background[all]==2.3.0; extra == "all"
22
+ Requires-Dist: winrt-Windows.Devices.Bluetooth.GenericAttributeProfile[all]==2.3.0; extra == "all"
23
+ Requires-Dist: winrt-Windows.Devices.Geolocation[all]==2.3.0; extra == "all"
24
+ Requires-Dist: winrt-Windows.Devices.Sensors[all]==2.3.0; extra == "all"
25
+ Requires-Dist: winrt-Windows.Devices.SmartCards[all]==2.3.0; extra == "all"
26
+ Requires-Dist: winrt-Windows.Devices.Sms[all]==2.3.0; extra == "all"
27
+ Requires-Dist: winrt-Windows.Foundation[all]==2.3.0; extra == "all"
28
+ Requires-Dist: winrt-Windows.Foundation.Collections[all]==2.3.0; extra == "all"
29
+ Requires-Dist: winrt-Windows.Networking[all]==2.3.0; extra == "all"
30
+ Requires-Dist: winrt-Windows.Networking.Sockets[all]==2.3.0; extra == "all"
31
+ Requires-Dist: winrt-Windows.Storage[all]==2.3.0; extra == "all"
32
+ Requires-Dist: winrt-Windows.Storage.Provider[all]==2.3.0; extra == "all"
33
+ Requires-Dist: winrt-Windows.System[all]==2.3.0; extra == "all"
34
+ Requires-Dist: winrt-Windows.UI.Notifications[all]==2.3.0; extra == "all"
35
35
 
36
36
  <!-- warning: Please don't edit this file. It was automatically generated. -->
37
37
 
@@ -0,0 +1,20 @@
1
+ # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.3.0
2
+
3
+ winrt-Windows.ApplicationModel.Activation[all]==2.3.0
4
+ winrt-Windows.ApplicationModel.Calls.Background[all]==2.3.0
5
+ winrt-Windows.Devices.Bluetooth[all]==2.3.0
6
+ winrt-Windows.Devices.Bluetooth.Advertisement[all]==2.3.0
7
+ winrt-Windows.Devices.Bluetooth.Background[all]==2.3.0
8
+ winrt-Windows.Devices.Bluetooth.GenericAttributeProfile[all]==2.3.0
9
+ winrt-Windows.Devices.Geolocation[all]==2.3.0
10
+ winrt-Windows.Devices.Sensors[all]==2.3.0
11
+ winrt-Windows.Devices.SmartCards[all]==2.3.0
12
+ winrt-Windows.Devices.Sms[all]==2.3.0
13
+ winrt-Windows.Foundation[all]==2.3.0
14
+ winrt-Windows.Foundation.Collections[all]==2.3.0
15
+ winrt-Windows.Networking[all]==2.3.0
16
+ winrt-Windows.Networking.Sockets[all]==2.3.0
17
+ winrt-Windows.Storage[all]==2.3.0
18
+ winrt-Windows.Storage.Provider[all]==2.3.0
19
+ winrt-Windows.System[all]==2.3.0
20
+ winrt-Windows.UI.Notifications[all]==2.3.0
@@ -1,4 +1,4 @@
1
- // WARNING: Please don't edit this file. It was generated by Python/WinRT v2.2.0
1
+ // WARNING: Please don't edit this file. It was generated by Python/WinRT v2.3.0
2
2
 
3
3
  #include "py.Windows.ApplicationModel.Background.h"
4
4
 
@@ -1756,6 +1756,33 @@ namespace py::cpp::Windows::ApplicationModel::Background
1756
1756
  return nullptr;
1757
1757
  }
1758
1758
  }
1759
+ else if (arg_count == 1)
1760
+ {
1761
+ try
1762
+ {
1763
+ static std::optional<bool> is_overload_present{};
1764
+
1765
+ if (!is_overload_present.has_value())
1766
+ {
1767
+ is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.ApplicationModel.Background.BackgroundTaskBuilder", L"Register", 1);
1768
+ }
1769
+
1770
+ if (!is_overload_present.value())
1771
+ {
1772
+ py::set_arg_count_version_error(1);
1773
+ return nullptr;
1774
+ }
1775
+
1776
+ auto param0 = py::convert_to<winrt::hstring>(args, 0);
1777
+
1778
+ return py::convert(self->obj.Register(param0));
1779
+ }
1780
+ catch (...)
1781
+ {
1782
+ py::to_PyErr();
1783
+ return nullptr;
1784
+ }
1785
+ }
1759
1786
  else
1760
1787
  {
1761
1788
  py::set_invalid_arg_count_error(arg_count);
@@ -1841,6 +1868,42 @@ namespace py::cpp::Windows::ApplicationModel::Background
1841
1868
  }
1842
1869
  }
1843
1870
 
1871
+ static PyObject* BackgroundTaskBuilder_Validate(py::wrapper::Windows::ApplicationModel::Background::BackgroundTaskBuilder* self, PyObject* args) noexcept
1872
+ {
1873
+ auto arg_count = PyTuple_Size(args);
1874
+
1875
+ if (arg_count == 0)
1876
+ {
1877
+ try
1878
+ {
1879
+ static std::optional<bool> is_overload_present{};
1880
+
1881
+ if (!is_overload_present.has_value())
1882
+ {
1883
+ is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.ApplicationModel.Background.BackgroundTaskBuilder", L"Validate", 0);
1884
+ }
1885
+
1886
+ if (!is_overload_present.value())
1887
+ {
1888
+ py::set_arg_count_version_error(0);
1889
+ return nullptr;
1890
+ }
1891
+
1892
+ return py::convert(self->obj.Validate());
1893
+ }
1894
+ catch (...)
1895
+ {
1896
+ py::to_PyErr();
1897
+ return nullptr;
1898
+ }
1899
+ }
1900
+ else
1901
+ {
1902
+ py::set_invalid_arg_count_error(arg_count);
1903
+ return nullptr;
1904
+ }
1905
+ }
1906
+
1844
1907
  static PyObject* BackgroundTaskBuilder_get_TaskEntryPoint(py::wrapper::Windows::ApplicationModel::Background::BackgroundTaskBuilder* self, void* /*unused*/) noexcept
1845
1908
  {
1846
1909
  try
@@ -2146,6 +2209,93 @@ namespace py::cpp::Windows::ApplicationModel::Background
2146
2209
  }
2147
2210
  }
2148
2211
 
2212
+ static PyObject* BackgroundTaskBuilder_get_AllowRunningTaskInStandby(py::wrapper::Windows::ApplicationModel::Background::BackgroundTaskBuilder* self, void* /*unused*/) noexcept
2213
+ {
2214
+ try
2215
+ {
2216
+ static std::optional<bool> is_property_present{};
2217
+
2218
+ if (!is_property_present.has_value())
2219
+ {
2220
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.Background.BackgroundTaskBuilder", L"AllowRunningTaskInStandby");
2221
+ }
2222
+
2223
+ if (!is_property_present.value())
2224
+ {
2225
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
2226
+ return nullptr;
2227
+ }
2228
+
2229
+ return py::convert(self->obj.AllowRunningTaskInStandby());
2230
+ }
2231
+ catch (...)
2232
+ {
2233
+ py::to_PyErr();
2234
+ return nullptr;
2235
+ }
2236
+ }
2237
+
2238
+ static int BackgroundTaskBuilder_put_AllowRunningTaskInStandby(py::wrapper::Windows::ApplicationModel::Background::BackgroundTaskBuilder* self, PyObject* arg, void* /*unused*/) noexcept
2239
+ {
2240
+ if (arg == nullptr)
2241
+ {
2242
+ PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
2243
+ return -1;
2244
+ }
2245
+
2246
+ try
2247
+ {
2248
+ static std::optional<bool> is_property_present{};
2249
+
2250
+ if (!is_property_present.has_value())
2251
+ {
2252
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.Background.BackgroundTaskBuilder", L"AllowRunningTaskInStandby");
2253
+ }
2254
+
2255
+ if (!is_property_present.value())
2256
+ {
2257
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
2258
+ return -1;
2259
+ }
2260
+
2261
+ auto param0 = py::convert_to<bool>(arg);
2262
+
2263
+ self->obj.AllowRunningTaskInStandby(param0);
2264
+ return 0;
2265
+ }
2266
+ catch (...)
2267
+ {
2268
+ py::to_PyErr();
2269
+ return -1;
2270
+ }
2271
+ }
2272
+
2273
+ static PyObject* BackgroundTaskBuilder_get_IsRunningTaskInStandbySupported(PyObject* /*unused*/, void* /*unused*/) noexcept
2274
+ {
2275
+ try
2276
+ {
2277
+ static std::optional<bool> is_property_present{};
2278
+
2279
+ if (!is_property_present.has_value())
2280
+ {
2281
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.Background.BackgroundTaskBuilder", L"IsRunningTaskInStandbySupported");
2282
+ }
2283
+
2284
+ if (!is_property_present.value())
2285
+ {
2286
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
2287
+ return nullptr;
2288
+ }
2289
+
2290
+ return py::convert(winrt::Windows::ApplicationModel::Background::BackgroundTaskBuilder::IsRunningTaskInStandbySupported());
2291
+ }
2292
+ catch (...)
2293
+ {
2294
+ py::to_PyErr();
2295
+ return nullptr;
2296
+ }
2297
+ }
2298
+
2149
2299
  static PyObject* _assign_array_BackgroundTaskBuilder(PyObject* /*unused*/, PyObject* arg) noexcept
2150
2300
  {
2151
2301
  auto array = std::make_unique<py::ComArray<winrt::Windows::ApplicationModel::Background::BackgroundTaskBuilder>>();
@@ -2175,6 +2325,7 @@ namespace py::cpp::Windows::ApplicationModel::Background
2175
2325
  { "register", reinterpret_cast<PyCFunction>(BackgroundTaskBuilder_Register), METH_VARARGS, nullptr },
2176
2326
  { "set_task_entry_point_clsid", reinterpret_cast<PyCFunction>(BackgroundTaskBuilder_SetTaskEntryPointClsid), METH_VARARGS, nullptr },
2177
2327
  { "set_trigger", reinterpret_cast<PyCFunction>(BackgroundTaskBuilder_SetTrigger), METH_VARARGS, nullptr },
2328
+ { "validate", reinterpret_cast<PyCFunction>(BackgroundTaskBuilder_Validate), METH_VARARGS, nullptr },
2178
2329
  { "_assign_array_", _assign_array_BackgroundTaskBuilder, METH_O | METH_STATIC, nullptr },
2179
2330
  { "_from", reinterpret_cast<PyCFunction>(_from_BackgroundTaskBuilder), METH_O | METH_STATIC, nullptr },
2180
2331
  { }
@@ -2186,6 +2337,7 @@ namespace py::cpp::Windows::ApplicationModel::Background
2186
2337
  { "cancel_on_condition_loss", reinterpret_cast<getter>(BackgroundTaskBuilder_get_CancelOnConditionLoss), reinterpret_cast<setter>(BackgroundTaskBuilder_put_CancelOnConditionLoss), nullptr, nullptr },
2187
2338
  { "is_network_requested", reinterpret_cast<getter>(BackgroundTaskBuilder_get_IsNetworkRequested), reinterpret_cast<setter>(BackgroundTaskBuilder_put_IsNetworkRequested), nullptr, nullptr },
2188
2339
  { "task_group", reinterpret_cast<getter>(BackgroundTaskBuilder_get_TaskGroup), reinterpret_cast<setter>(BackgroundTaskBuilder_put_TaskGroup), nullptr, nullptr },
2340
+ { "allow_running_task_in_standby", reinterpret_cast<getter>(BackgroundTaskBuilder_get_AllowRunningTaskInStandby), reinterpret_cast<setter>(BackgroundTaskBuilder_put_AllowRunningTaskInStandby), nullptr, nullptr },
2189
2341
  { }
2190
2342
  };
2191
2343
 
@@ -2204,6 +2356,32 @@ namespace py::cpp::Windows::ApplicationModel::Background
2204
2356
  Py_TPFLAGS_DEFAULT,
2205
2357
  _type_slots_BackgroundTaskBuilder};
2206
2358
 
2359
+ static PyGetSetDef getset_BackgroundTaskBuilder_Static[] = {
2360
+ { "is_running_task_in_standby_supported", reinterpret_cast<getter>(BackgroundTaskBuilder_get_IsRunningTaskInStandbySupported), nullptr, nullptr, nullptr },
2361
+ { }
2362
+ };
2363
+
2364
+ static PyMethodDef methods_BackgroundTaskBuilder_Static[] = {
2365
+ { }
2366
+ };
2367
+
2368
+ static PyType_Slot type_slots_BackgroundTaskBuilder_Static[] =
2369
+ {
2370
+ { Py_tp_base, reinterpret_cast<void*>(&PyType_Type) },
2371
+ { Py_tp_getset, reinterpret_cast<void*>(getset_BackgroundTaskBuilder_Static) },
2372
+ { Py_tp_methods, reinterpret_cast<void*>(methods_BackgroundTaskBuilder_Static) },
2373
+ { }
2374
+ };
2375
+
2376
+ static PyType_Spec type_spec_BackgroundTaskBuilder_Static =
2377
+ {
2378
+ "winrt._winrt_windows_applicationmodel_background.BackgroundTaskBuilder_Static",
2379
+ static_cast<int>(PyType_Type.tp_basicsize),
2380
+ static_cast<int>(PyType_Type.tp_itemsize),
2381
+ Py_TPFLAGS_DEFAULT,
2382
+ type_slots_BackgroundTaskBuilder_Static
2383
+ };
2384
+
2207
2385
  // ----- BackgroundTaskCompletedEventArgs class --------------------
2208
2386
 
2209
2387
  static PyObject* _new_BackgroundTaskCompletedEventArgs(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
@@ -2757,6 +2935,58 @@ namespace py::cpp::Windows::ApplicationModel::Background
2757
2935
  }
2758
2936
  }
2759
2937
 
2938
+ static PyObject* BackgroundTaskRegistration_get_AppEnergyUsePredictionContribution(py::wrapper::Windows::ApplicationModel::Background::BackgroundTaskRegistration* self, void* /*unused*/) noexcept
2939
+ {
2940
+ try
2941
+ {
2942
+ static std::optional<bool> is_property_present{};
2943
+
2944
+ if (!is_property_present.has_value())
2945
+ {
2946
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.Background.BackgroundTaskRegistration", L"AppEnergyUsePredictionContribution");
2947
+ }
2948
+
2949
+ if (!is_property_present.value())
2950
+ {
2951
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
2952
+ return nullptr;
2953
+ }
2954
+
2955
+ return py::convert(self->obj.AppEnergyUsePredictionContribution());
2956
+ }
2957
+ catch (...)
2958
+ {
2959
+ py::to_PyErr();
2960
+ return nullptr;
2961
+ }
2962
+ }
2963
+
2964
+ static PyObject* BackgroundTaskRegistration_get_TaskLastThrottledInStandbyTimestamp(py::wrapper::Windows::ApplicationModel::Background::BackgroundTaskRegistration* self, void* /*unused*/) noexcept
2965
+ {
2966
+ try
2967
+ {
2968
+ static std::optional<bool> is_property_present{};
2969
+
2970
+ if (!is_property_present.has_value())
2971
+ {
2972
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.Background.BackgroundTaskRegistration", L"TaskLastThrottledInStandbyTimestamp");
2973
+ }
2974
+
2975
+ if (!is_property_present.value())
2976
+ {
2977
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
2978
+ return nullptr;
2979
+ }
2980
+
2981
+ return py::convert(self->obj.TaskLastThrottledInStandbyTimestamp());
2982
+ }
2983
+ catch (...)
2984
+ {
2985
+ py::to_PyErr();
2986
+ return nullptr;
2987
+ }
2988
+ }
2989
+
2760
2990
  static PyObject* BackgroundTaskRegistration_get_AllTasks(PyObject* /*unused*/, void* /*unused*/) noexcept
2761
2991
  {
2762
2992
  try
@@ -2963,6 +3193,8 @@ namespace py::cpp::Windows::ApplicationModel::Background
2963
3193
  { "task_id", reinterpret_cast<getter>(BackgroundTaskRegistration_get_TaskId), nullptr, nullptr, nullptr },
2964
3194
  { "trigger", reinterpret_cast<getter>(BackgroundTaskRegistration_get_Trigger), nullptr, nullptr, nullptr },
2965
3195
  { "task_group", reinterpret_cast<getter>(BackgroundTaskRegistration_get_TaskGroup), nullptr, nullptr, nullptr },
3196
+ { "app_energy_use_prediction_contribution", reinterpret_cast<getter>(BackgroundTaskRegistration_get_AppEnergyUsePredictionContribution), nullptr, nullptr, nullptr },
3197
+ { "task_last_throttled_in_standby_timestamp", reinterpret_cast<getter>(BackgroundTaskRegistration_get_TaskLastThrottledInStandbyTimestamp), nullptr, nullptr, nullptr },
2966
3198
  { }
2967
3199
  };
2968
3200
 
@@ -3290,6 +3522,84 @@ namespace py::cpp::Windows::ApplicationModel::Background
3290
3522
  }
3291
3523
  }
3292
3524
 
3525
+ static PyObject* BackgroundWorkCost_get_AppEnergyUseLevel(PyObject* /*unused*/, void* /*unused*/) noexcept
3526
+ {
3527
+ try
3528
+ {
3529
+ static std::optional<bool> is_property_present{};
3530
+
3531
+ if (!is_property_present.has_value())
3532
+ {
3533
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.Background.BackgroundWorkCost", L"AppEnergyUseLevel");
3534
+ }
3535
+
3536
+ if (!is_property_present.value())
3537
+ {
3538
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
3539
+ return nullptr;
3540
+ }
3541
+
3542
+ return py::convert(winrt::Windows::ApplicationModel::Background::BackgroundWorkCost::AppEnergyUseLevel());
3543
+ }
3544
+ catch (...)
3545
+ {
3546
+ py::to_PyErr();
3547
+ return nullptr;
3548
+ }
3549
+ }
3550
+
3551
+ static PyObject* BackgroundWorkCost_get_AppEnergyUsePrediction(PyObject* /*unused*/, void* /*unused*/) noexcept
3552
+ {
3553
+ try
3554
+ {
3555
+ static std::optional<bool> is_property_present{};
3556
+
3557
+ if (!is_property_present.has_value())
3558
+ {
3559
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.Background.BackgroundWorkCost", L"AppEnergyUsePrediction");
3560
+ }
3561
+
3562
+ if (!is_property_present.value())
3563
+ {
3564
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
3565
+ return nullptr;
3566
+ }
3567
+
3568
+ return py::convert(winrt::Windows::ApplicationModel::Background::BackgroundWorkCost::AppEnergyUsePrediction());
3569
+ }
3570
+ catch (...)
3571
+ {
3572
+ py::to_PyErr();
3573
+ return nullptr;
3574
+ }
3575
+ }
3576
+
3577
+ static PyObject* BackgroundWorkCost_get_AppLastThrottledInStandbyTimestamp(PyObject* /*unused*/, void* /*unused*/) noexcept
3578
+ {
3579
+ try
3580
+ {
3581
+ static std::optional<bool> is_property_present{};
3582
+
3583
+ if (!is_property_present.has_value())
3584
+ {
3585
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.Background.BackgroundWorkCost", L"AppLastThrottledInStandbyTimestamp");
3586
+ }
3587
+
3588
+ if (!is_property_present.value())
3589
+ {
3590
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
3591
+ return nullptr;
3592
+ }
3593
+
3594
+ return py::convert(winrt::Windows::ApplicationModel::Background::BackgroundWorkCost::AppLastThrottledInStandbyTimestamp());
3595
+ }
3596
+ catch (...)
3597
+ {
3598
+ py::to_PyErr();
3599
+ return nullptr;
3600
+ }
3601
+ }
3602
+
3293
3603
  static PyMethodDef _methods_BackgroundWorkCost[] = {
3294
3604
  { }
3295
3605
  };
@@ -3314,6 +3624,9 @@ namespace py::cpp::Windows::ApplicationModel::Background
3314
3624
 
3315
3625
  static PyGetSetDef getset_BackgroundWorkCost_Static[] = {
3316
3626
  { "current_background_work_cost", reinterpret_cast<getter>(BackgroundWorkCost_get_CurrentBackgroundWorkCost), nullptr, nullptr, nullptr },
3627
+ { "app_energy_use_level", reinterpret_cast<getter>(BackgroundWorkCost_get_AppEnergyUseLevel), nullptr, nullptr, nullptr },
3628
+ { "app_energy_use_prediction", reinterpret_cast<getter>(BackgroundWorkCost_get_AppEnergyUsePrediction), nullptr, nullptr, nullptr },
3629
+ { "app_last_throttled_in_standby_timestamp", reinterpret_cast<getter>(BackgroundWorkCost_get_AppLastThrottledInStandbyTimestamp), nullptr, nullptr, nullptr },
3317
3630
  { }
3318
3631
  };
3319
3632
 
@@ -12485,7 +12798,13 @@ PyMODINIT_FUNC PyInit__winrt_windows_applicationmodel_background(void) noexcept
12485
12798
  return nullptr;
12486
12799
  }
12487
12800
 
12488
- py::pytype_handle BackgroundTaskBuilder_type{py::register_python_type(module.get(), &type_spec_BackgroundTaskBuilder, object_bases.get(), nullptr)};
12801
+ py::pyobj_handle type_BackgroundTaskBuilder_Static{PyType_FromSpec(&type_spec_BackgroundTaskBuilder_Static)};
12802
+ if (!type_BackgroundTaskBuilder_Static)
12803
+ {
12804
+ return nullptr;
12805
+ }
12806
+
12807
+ py::pytype_handle BackgroundTaskBuilder_type{py::register_python_type(module.get(), &type_spec_BackgroundTaskBuilder, object_bases.get(), reinterpret_cast<PyTypeObject*>(type_BackgroundTaskBuilder_Static.get()))};
12489
12808
  if (!BackgroundTaskBuilder_type)
12490
12809
  {
12491
12810
  return nullptr;
@@ -1,3 +1,3 @@
1
- # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.2.0
1
+ # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.3.0
2
2
 
3
- winrt-runtime==2.2.0
3
+ winrt-runtime==2.3.0
@@ -1,4 +1,4 @@
1
- # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.2.0
1
+ # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.3.0
2
2
 
3
3
  import datetime
4
4
  import sys
@@ -28,7 +28,7 @@ import winrt.windows.storage.provider as windows_storage_provider
28
28
  import winrt.windows.system as windows_system
29
29
  import winrt.windows.ui.notifications as windows_ui_notifications
30
30
 
31
- from winrt.windows.applicationmodel.background import AlarmAccessStatus, ApplicationTriggerResult, BackgroundAccessRequestKind, BackgroundAccessStatus, BackgroundTaskCancellationReason, BackgroundTaskThrottleCounter, BackgroundWorkCostValue, CustomSystemEventTriggerRecurrence, DeviceTriggerResult, LocationTriggerType, MediaProcessingTriggerResult, SystemConditionType, SystemTriggerType
31
+ from winrt.windows.applicationmodel.background import AlarmAccessStatus, ApplicationTriggerResult, BackgroundAccessRequestKind, BackgroundAccessStatus, BackgroundTaskCancellationReason, BackgroundTaskThrottleCounter, BackgroundWorkCostValue, CustomSystemEventTriggerRecurrence, DeviceTriggerResult, EnergyUseLevel, LocationTriggerType, MediaProcessingTriggerResult, SystemConditionType, SystemTriggerType
32
32
  from winrt.windows.applicationmodel.background import BackgroundTaskCanceledEventHandler, BackgroundTaskCompletedEventHandler, BackgroundTaskProgressEventHandler
33
33
 
34
34
  Self = typing.TypeVar('Self')
@@ -144,14 +144,23 @@ class BackgroundExecutionManager(winrt.system.Object, metaclass=BackgroundExecut
144
144
  pass
145
145
 
146
146
  @typing.final
147
- class BackgroundTaskBuilder(winrt.system.Object):
147
+ class BackgroundTaskBuilder_Static(type):
148
+ @_property
149
+ def is_running_task_in_standby_supported(cls) -> bool: ...
150
+
151
+ @typing.final
152
+ class BackgroundTaskBuilder(winrt.system.Object, metaclass=BackgroundTaskBuilder_Static):
148
153
  @staticmethod
149
154
  def _from(obj: winrt.system.Object, /) -> BackgroundTaskBuilder: ...
150
155
  def __new__(cls: typing.Type[BackgroundTaskBuilder]) -> BackgroundTaskBuilder: ...
151
156
  def add_condition(self, condition: typing.Optional[IBackgroundCondition], /) -> None: ...
157
+ @typing.overload
152
158
  def register(self) -> typing.Optional[BackgroundTaskRegistration]: ...
159
+ @typing.overload
160
+ def register(self, task_name: str, /) -> typing.Optional[BackgroundTaskRegistration]: ...
153
161
  def set_task_entry_point_clsid(self, task_entry_point: _uuid.UUID, /) -> None: ...
154
162
  def set_trigger(self, trigger: typing.Optional[IBackgroundTrigger], /) -> None: ...
163
+ def validate(self) -> bool: ...
155
164
  @_property
156
165
  def task_entry_point(self) -> str: ...
157
166
  @task_entry_point.setter
@@ -172,6 +181,10 @@ class BackgroundTaskBuilder(winrt.system.Object):
172
181
  def task_group(self) -> typing.Optional[BackgroundTaskRegistrationGroup]: ...
173
182
  @task_group.setter
174
183
  def task_group(self, value: typing.Optional[BackgroundTaskRegistrationGroup]) -> None: ...
184
+ @_property
185
+ def allow_running_task_in_standby(self) -> bool: ...
186
+ @allow_running_task_in_standby.setter
187
+ def allow_running_task_in_standby(self, value: bool) -> None: ...
175
188
 
176
189
  @typing.final
177
190
  class BackgroundTaskCompletedEventArgs(winrt.system.Object):
@@ -221,6 +234,10 @@ class BackgroundTaskRegistration(winrt.system.Object, metaclass=BackgroundTaskRe
221
234
  def trigger(self) -> typing.Optional[IBackgroundTrigger]: ...
222
235
  @_property
223
236
  def task_group(self) -> typing.Optional[BackgroundTaskRegistrationGroup]: ...
237
+ @_property
238
+ def app_energy_use_prediction_contribution(self) -> winrt.system.Double: ...
239
+ @_property
240
+ def task_last_throttled_in_standby_timestamp(self) -> datetime.datetime: ...
224
241
 
225
242
  @typing.final
226
243
  class BackgroundTaskRegistrationGroup(winrt.system.Object):
@@ -243,6 +260,12 @@ class BackgroundTaskRegistrationGroup(winrt.system.Object):
243
260
  class BackgroundWorkCost_Static(type):
244
261
  @_property
245
262
  def current_background_work_cost(cls) -> BackgroundWorkCostValue: ...
263
+ @_property
264
+ def app_energy_use_level(cls) -> EnergyUseLevel: ...
265
+ @_property
266
+ def app_energy_use_prediction(cls) -> EnergyUseLevel: ...
267
+ @_property
268
+ def app_last_throttled_in_standby_timestamp(cls) -> datetime.datetime: ...
246
269
 
247
270
  @typing.final
248
271
  class BackgroundWorkCost(winrt.system.Object, metaclass=BackgroundWorkCost_Static):
@@ -1,4 +1,4 @@
1
- # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.2.0
1
+ # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.3.0
2
2
 
3
3
  import enum
4
4
  import typing
@@ -17,6 +17,7 @@ __all__ = [
17
17
  "BackgroundWorkCostValue",
18
18
  "CustomSystemEventTriggerRecurrence",
19
19
  "DeviceTriggerResult",
20
+ "EnergyUseLevel",
20
21
  "LocationTriggerType",
21
22
  "MediaProcessingTriggerResult",
22
23
  "SystemConditionType",
@@ -163,6 +164,12 @@ class DeviceTriggerResult(enum.IntEnum):
163
164
  DENIED_BY_SYSTEM = 2
164
165
  LOW_BATTERY = 3
165
166
 
167
+ class EnergyUseLevel(enum.IntEnum):
168
+ UNKNOWN = 0
169
+ UNDER_HALF_OF_BUDGET = 1
170
+ OVER_HALF_OF_BUDGET = 2
171
+ OVER_BUDGET = 3
172
+
166
173
  class LocationTriggerType(enum.IntEnum):
167
174
  GEOFENCE = 0
168
175
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: winrt-Windows.ApplicationModel.Background
3
- Version: 2.2.0
3
+ Version: 2.3.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,26 +12,26 @@ Classifier: Programming Language :: Python :: Implementation :: CPython
12
12
  Classifier: Intended Audience :: Developers
13
13
  Requires-Python: <3.14,>=3.9
14
14
  Description-Content-Type: text/markdown
15
- Requires-Dist: winrt-runtime==2.2.0
15
+ Requires-Dist: winrt-runtime==2.3.0
16
16
  Provides-Extra: all
17
- Requires-Dist: winrt-Windows.ApplicationModel.Activation[all]==2.2.0; extra == "all"
18
- Requires-Dist: winrt-Windows.ApplicationModel.Calls.Background[all]==2.2.0; extra == "all"
19
- Requires-Dist: winrt-Windows.Devices.Bluetooth[all]==2.2.0; extra == "all"
20
- Requires-Dist: winrt-Windows.Devices.Bluetooth.Advertisement[all]==2.2.0; extra == "all"
21
- Requires-Dist: winrt-Windows.Devices.Bluetooth.Background[all]==2.2.0; extra == "all"
22
- Requires-Dist: winrt-Windows.Devices.Bluetooth.GenericAttributeProfile[all]==2.2.0; extra == "all"
23
- Requires-Dist: winrt-Windows.Devices.Geolocation[all]==2.2.0; extra == "all"
24
- Requires-Dist: winrt-Windows.Devices.Sensors[all]==2.2.0; extra == "all"
25
- Requires-Dist: winrt-Windows.Devices.SmartCards[all]==2.2.0; extra == "all"
26
- Requires-Dist: winrt-Windows.Devices.Sms[all]==2.2.0; extra == "all"
27
- Requires-Dist: winrt-Windows.Foundation[all]==2.2.0; extra == "all"
28
- Requires-Dist: winrt-Windows.Foundation.Collections[all]==2.2.0; extra == "all"
29
- Requires-Dist: winrt-Windows.Networking[all]==2.2.0; extra == "all"
30
- Requires-Dist: winrt-Windows.Networking.Sockets[all]==2.2.0; extra == "all"
31
- Requires-Dist: winrt-Windows.Storage[all]==2.2.0; extra == "all"
32
- Requires-Dist: winrt-Windows.Storage.Provider[all]==2.2.0; extra == "all"
33
- Requires-Dist: winrt-Windows.System[all]==2.2.0; extra == "all"
34
- Requires-Dist: winrt-Windows.UI.Notifications[all]==2.2.0; extra == "all"
17
+ Requires-Dist: winrt-Windows.ApplicationModel.Activation[all]==2.3.0; extra == "all"
18
+ Requires-Dist: winrt-Windows.ApplicationModel.Calls.Background[all]==2.3.0; extra == "all"
19
+ Requires-Dist: winrt-Windows.Devices.Bluetooth[all]==2.3.0; extra == "all"
20
+ Requires-Dist: winrt-Windows.Devices.Bluetooth.Advertisement[all]==2.3.0; extra == "all"
21
+ Requires-Dist: winrt-Windows.Devices.Bluetooth.Background[all]==2.3.0; extra == "all"
22
+ Requires-Dist: winrt-Windows.Devices.Bluetooth.GenericAttributeProfile[all]==2.3.0; extra == "all"
23
+ Requires-Dist: winrt-Windows.Devices.Geolocation[all]==2.3.0; extra == "all"
24
+ Requires-Dist: winrt-Windows.Devices.Sensors[all]==2.3.0; extra == "all"
25
+ Requires-Dist: winrt-Windows.Devices.SmartCards[all]==2.3.0; extra == "all"
26
+ Requires-Dist: winrt-Windows.Devices.Sms[all]==2.3.0; extra == "all"
27
+ Requires-Dist: winrt-Windows.Foundation[all]==2.3.0; extra == "all"
28
+ Requires-Dist: winrt-Windows.Foundation.Collections[all]==2.3.0; extra == "all"
29
+ Requires-Dist: winrt-Windows.Networking[all]==2.3.0; extra == "all"
30
+ Requires-Dist: winrt-Windows.Networking.Sockets[all]==2.3.0; extra == "all"
31
+ Requires-Dist: winrt-Windows.Storage[all]==2.3.0; extra == "all"
32
+ Requires-Dist: winrt-Windows.Storage.Provider[all]==2.3.0; extra == "all"
33
+ Requires-Dist: winrt-Windows.System[all]==2.3.0; extra == "all"
34
+ Requires-Dist: winrt-Windows.UI.Notifications[all]==2.3.0; extra == "all"
35
35
 
36
36
  <!-- warning: Please don't edit this file. It was automatically generated. -->
37
37
 
@@ -0,0 +1,21 @@
1
+ winrt-runtime==2.3.0
2
+
3
+ [all]
4
+ winrt-Windows.ApplicationModel.Activation[all]==2.3.0
5
+ winrt-Windows.ApplicationModel.Calls.Background[all]==2.3.0
6
+ winrt-Windows.Devices.Bluetooth[all]==2.3.0
7
+ winrt-Windows.Devices.Bluetooth.Advertisement[all]==2.3.0
8
+ winrt-Windows.Devices.Bluetooth.Background[all]==2.3.0
9
+ winrt-Windows.Devices.Bluetooth.GenericAttributeProfile[all]==2.3.0
10
+ winrt-Windows.Devices.Geolocation[all]==2.3.0
11
+ winrt-Windows.Devices.Sensors[all]==2.3.0
12
+ winrt-Windows.Devices.SmartCards[all]==2.3.0
13
+ winrt-Windows.Devices.Sms[all]==2.3.0
14
+ winrt-Windows.Foundation[all]==2.3.0
15
+ winrt-Windows.Foundation.Collections[all]==2.3.0
16
+ winrt-Windows.Networking[all]==2.3.0
17
+ winrt-Windows.Networking.Sockets[all]==2.3.0
18
+ winrt-Windows.Storage[all]==2.3.0
19
+ winrt-Windows.Storage.Provider[all]==2.3.0
20
+ winrt-Windows.System[all]==2.3.0
21
+ winrt-Windows.UI.Notifications[all]==2.3.0
@@ -1,20 +0,0 @@
1
- # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.2.0
2
-
3
- winrt-Windows.ApplicationModel.Activation[all]==2.2.0
4
- winrt-Windows.ApplicationModel.Calls.Background[all]==2.2.0
5
- winrt-Windows.Devices.Bluetooth[all]==2.2.0
6
- winrt-Windows.Devices.Bluetooth.Advertisement[all]==2.2.0
7
- winrt-Windows.Devices.Bluetooth.Background[all]==2.2.0
8
- winrt-Windows.Devices.Bluetooth.GenericAttributeProfile[all]==2.2.0
9
- winrt-Windows.Devices.Geolocation[all]==2.2.0
10
- winrt-Windows.Devices.Sensors[all]==2.2.0
11
- winrt-Windows.Devices.SmartCards[all]==2.2.0
12
- winrt-Windows.Devices.Sms[all]==2.2.0
13
- winrt-Windows.Foundation[all]==2.2.0
14
- winrt-Windows.Foundation.Collections[all]==2.2.0
15
- winrt-Windows.Networking[all]==2.2.0
16
- winrt-Windows.Networking.Sockets[all]==2.2.0
17
- winrt-Windows.Storage[all]==2.2.0
18
- winrt-Windows.Storage.Provider[all]==2.2.0
19
- winrt-Windows.System[all]==2.2.0
20
- winrt-Windows.UI.Notifications[all]==2.2.0
@@ -1,21 +0,0 @@
1
- winrt-runtime==2.2.0
2
-
3
- [all]
4
- winrt-Windows.ApplicationModel.Activation[all]==2.2.0
5
- winrt-Windows.ApplicationModel.Calls.Background[all]==2.2.0
6
- winrt-Windows.Devices.Bluetooth[all]==2.2.0
7
- winrt-Windows.Devices.Bluetooth.Advertisement[all]==2.2.0
8
- winrt-Windows.Devices.Bluetooth.Background[all]==2.2.0
9
- winrt-Windows.Devices.Bluetooth.GenericAttributeProfile[all]==2.2.0
10
- winrt-Windows.Devices.Geolocation[all]==2.2.0
11
- winrt-Windows.Devices.Sensors[all]==2.2.0
12
- winrt-Windows.Devices.SmartCards[all]==2.2.0
13
- winrt-Windows.Devices.Sms[all]==2.2.0
14
- winrt-Windows.Foundation[all]==2.2.0
15
- winrt-Windows.Foundation.Collections[all]==2.2.0
16
- winrt-Windows.Networking[all]==2.2.0
17
- winrt-Windows.Networking.Sockets[all]==2.2.0
18
- winrt-Windows.Storage[all]==2.2.0
19
- winrt-Windows.Storage.Provider[all]==2.2.0
20
- winrt-Windows.System[all]==2.2.0
21
- winrt-Windows.UI.Notifications[all]==2.2.0