Skip to content

Commit 8938880

Browse files
authored
Merge pull request #1977 from rmartin16/automation
Replace `add_background_task()` in Toga automation bootstrap
2 parents af1430a + 7988371 commit 8938880

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

automation/src/automation/bootstraps/toga.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,8 @@ def startup(self):
2626
self.main_window.content = main_box
2727
self.main_window.show()
2828
29-
self.add_background_task(self.exit_soon)
30-
31-
async def exit_soon(self, app: toga.App, **kwargs):
32-
"""Background task that closes the app after a few seconds."""
29+
async def on_running(self):
30+
"""Close the app after a few seconds."""
3331
await asyncio.sleep(2)
3432
print("{EXIT_SUCCESS_NOTIFY}")
3533
print("{BRIEFCASE_EXIT_SUCCESS_SIGNAL}")

changes/1977.misc.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The deprecated ``add_background_task()`` API was replaced in the Toga automation bootstrap.

0 commit comments

Comments
 (0)