Skip to content

Commit

Permalink
Replace add_background_task() in Toga automation bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
rmartin16 committed Aug 29, 2024
1 parent af1430a commit 7988371
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 2 additions & 4 deletions automation/src/automation/bootstraps/toga.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@ def startup(self):
self.main_window.content = main_box
self.main_window.show()
self.add_background_task(self.exit_soon)
async def exit_soon(self, app: toga.App, **kwargs):
"""Background task that closes the app after a few seconds."""
async def on_running(self):
"""Close the app after a few seconds."""
await asyncio.sleep(2)
print("{EXIT_SUCCESS_NOTIFY}")
print("{BRIEFCASE_EXIT_SUCCESS_SIGNAL}")
Expand Down
1 change: 1 addition & 0 deletions changes/1977.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The deprecated ``add_background_task()`` API was replaced in the Toga automation bootstrap.

0 comments on commit 7988371

Please sign in to comment.