Skip to content

Commit

Permalink
Merge pull request #492 from artoonie/fix-anim
Browse files Browse the repository at this point in the history
wait for animation to complete
  • Loading branch information
artoonie authored Mar 26, 2024
2 parents 22ab5e5 + cc026a1 commit 0cf4399
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions movie/creation/movieCreator.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,16 +127,16 @@ def _set_captions_on_page(self, roundNum, caption, showGraphTitleInsteadOfRoundN

def _generate_image_for_round_synchronously(self, roundNum):
try:
self.browser.execute_script(f'transitionEachBarForRound({roundNum});')
self.browser.execute_script(f'transitionEachBarForRound({roundNum})')
except selenium.common.exceptions.JavascriptException as exception:
errorText = "This error commonly occurs with Xvfb issues: "
errorText += str(exception)
errorText += "\n\nCurrent browser context:\n"
errorText += self.browser.page_source[0:1000]
raise ProbablyFailedToLaunchBrowser(errorText) from exception

time.sleep(0.3) # flushAllD3Transitions doesn't seem to work, so just sleep
# self.browser.execute_script("flushAllD3Transitions();")
self.browser.execute_script("flushAllD3Transitions();")
time.sleep(0.6) # flushAllD3Transitions doesn't seem to work, so just sleep

with tempfile.NamedTemporaryFile(suffix=".png") as tf:
self.browser.save_screenshot(tf.name)
Expand Down

0 comments on commit 0cf4399

Please sign in to comment.