Fixes screenshot generator to work for generating all languages at once #5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Running the screenshot generator for all languages would succeed on the first language, but then throw an exception when trying to restart a Toast thread. Beside that, other issues occurred due to how the first run through changes the Controller state and does not reset it for the next language's run.
The visual diff here is hard to digest, but the changes are actually very minor. The Controller setup and the list of target Views (
screenshot_sections
) are just wrapped into their own method that gets called for each language to ensure a clean state and no already-instantiated / already-running Toasts.Sig type and script type are explicitly set in Settings, otherwise the related selection Views during xpub export won't render (the first test run sets each to a single option so a naive follow-up run will cause those Views to auto-skip themselves since there are no choices to make).
This pull request is categorized as a:
Checklist
pytest
and made sure all unit tests pass before sumbitting the PRIf you modified or added functionality/workflow, did you add new unit tests?
I have tested this PR on the following platforms/os: