Merge pull request #806 from kdmukai/screenshotcomplete_cleanup

[Screenshot Generator][Refactor] Clean up the end of the screenshot generation process
This commit is contained in:
Nick Klockenga
2025-09-02 22:42:15 -04:00
committed by GitHub
+2 -10
View File
@@ -430,18 +430,10 @@ def generate_screenshots(locale):
controller.activate_toast(toast_thread)
while controller.toast_notification_thread.is_alive():
# Give the Toast a moment to complete its work
time.sleep(0.01)
# TODO: Necessary now that the lock is in place?
# Whenever possible, clean up toast thread HERE before killing the
# main thread with ScreenshotComplete.
toast_thread.stop()
toast_thread.join()
raise ScreenshotComplete()
except ScreenshotComplete:
# Slightly hacky way to exit ScreenshotRenderer as expected
print(f"Completed {screenshot_config.screenshot_name}")
print(f"Completed {screenshot_config.screenshot_name}")
except Exception as e:
# Something else went wrong
from traceback import print_exc