From 5f264c514a9ddf495d255e408c6db62ce1f5ffee Mon Sep 17 00:00:00 2001 From: Annelein <48122190+Annelein@users.noreply.github.com> Date: Thu, 21 Mar 2024 02:36:40 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=BB=20Add=20sleep=20prompt=20until=20l?= =?UTF-8?q?evel=207=20(#5277)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #4769 After level 7 'if' statements are possible and it gets a lot more complicated to run the sleep prompt in order. https://github.com/hedyorg/hedy/assets/48122190/a5854391-3a69-472a-9c70-4145a8f2b3e1 --- app.py | 36 +++++++++++--- messages.pot | 3 ++ static/js/app.ts | 50 +++++++++++++++++++- static/js/appbundle.js | 40 ++++++++++++++++ static/js/appbundle.js.map | 4 +- templates/incl/editor-and-output.html | 6 +++ translations/ar/LC_MESSAGES/messages.po | 3 ++ translations/bg/LC_MESSAGES/messages.po | 3 ++ translations/bn/LC_MESSAGES/messages.po | 3 ++ translations/ca/LC_MESSAGES/messages.po | 3 ++ translations/cs/LC_MESSAGES/messages.po | 3 ++ translations/cy/LC_MESSAGES/messages.po | 3 ++ translations/da/LC_MESSAGES/messages.po | 3 ++ translations/de/LC_MESSAGES/messages.po | 3 ++ translations/el/LC_MESSAGES/messages.po | 3 ++ translations/en/LC_MESSAGES/messages.po | 3 ++ translations/eo/LC_MESSAGES/messages.po | 3 ++ translations/es/LC_MESSAGES/messages.po | 3 ++ translations/et/LC_MESSAGES/messages.po | 3 ++ translations/fa/LC_MESSAGES/messages.po | 3 ++ translations/fi/LC_MESSAGES/messages.po | 3 ++ translations/fr/LC_MESSAGES/messages.po | 3 ++ translations/fy/LC_MESSAGES/messages.po | 3 ++ translations/he/LC_MESSAGES/messages.po | 3 ++ translations/hi/LC_MESSAGES/messages.po | 3 ++ translations/hu/LC_MESSAGES/messages.po | 3 ++ translations/ia/LC_MESSAGES/messages.po | 3 ++ translations/id/LC_MESSAGES/messages.po | 3 ++ translations/it/LC_MESSAGES/messages.po | 3 ++ translations/ja/LC_MESSAGES/messages.po | 3 ++ translations/kmr/LC_MESSAGES/messages.po | 3 ++ translations/ko/LC_MESSAGES/messages.po | 3 ++ translations/mi/LC_MESSAGES/messages.po | 3 ++ translations/nb_NO/LC_MESSAGES/messages.po | 3 ++ translations/nl/LC_MESSAGES/messages.po | 3 ++ translations/pa_PK/LC_MESSAGES/messages.po | 3 ++ translations/pap/LC_MESSAGES/messages.po | 3 ++ translations/pl/LC_MESSAGES/messages.po | 3 ++ translations/pt_BR/LC_MESSAGES/messages.po | 3 ++ translations/pt_PT/LC_MESSAGES/messages.po | 3 ++ translations/ro/LC_MESSAGES/messages.po | 3 ++ translations/ru/LC_MESSAGES/messages.po | 3 ++ translations/sq/LC_MESSAGES/messages.po | 3 ++ translations/sr/LC_MESSAGES/messages.po | 3 ++ translations/sv/LC_MESSAGES/messages.po | 3 ++ translations/sw/LC_MESSAGES/messages.po | 3 ++ translations/te/LC_MESSAGES/messages.po | 3 ++ translations/th/LC_MESSAGES/messages.po | 3 ++ translations/tl/LC_MESSAGES/messages.po | 3 ++ translations/tn/LC_MESSAGES/messages.po | 3 ++ translations/tr/LC_MESSAGES/messages.po | 3 ++ translations/uk/LC_MESSAGES/messages.po | 3 ++ translations/ur/LC_MESSAGES/messages.po | 3 ++ translations/vi/LC_MESSAGES/messages.po | 3 ++ translations/zh_Hans/LC_MESSAGES/messages.po | 3 ++ translations/zh_Hant/LC_MESSAGES/messages.po | 3 ++ 56 files changed, 280 insertions(+), 9 deletions(-) diff --git a/app.py b/app.py index 8faec6dd540..2792914ff47 100644 --- a/app.py +++ b/app.py @@ -599,12 +599,36 @@ def parse(): except Exception: pass - with querylog.log_time('detect_sleep'): - try: - # FH, Nov 2023: hmmm I don't love that this is not done in the same place as the other "has"es - response['has_sleep'] = 'sleep' in transpile_result.commands - except BaseException: - pass + if level < 7: + with querylog.log_time('detect_sleep'): + try: + # FH, Nov 2023: hmmm I don't love that this is not done in the same place as the other "has"es + sleep_list = [] + pattern = ( + r'time\.sleep\((?P