Skip to content

Commit

Permalink
Merge pull request #1977 from rmartin16/automation
Browse files Browse the repository at this point in the history
Replace `add_background_task()` in Toga automation bootstrap
  • Loading branch information
freakboy3742 authored Aug 29, 2024
2 parents af1430a + 7988371 commit 8938880
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 8938880

Please sign in to comment.