toggle quoted messageShow quoted text
Thanks for pointing this out. It actually works as expected, but I
will explain why.
The script uses a try/finally block. I think the following code
is pretty explanatory when executed:
You will notice that when executing test(), both 42 and Hello are
printed. In short, return brings you straight to the finally
block, and I think the function will first execute the finally
block and then returns.
On 7-9-2019 11:17, Noelia Ruiz wrote:
and @feerrenrut :
def script_toggleScreenCurtain(self, gesture):
message = None
screenCurtainName = "screenCurtain"
# Translators: Reported when the screen curtain is
message = _("Screen curtain not available")
If return, I think that the message won't be reported if screen
curtain is not available.
# Translators: Reported when the screen curtain could not be
message = _("Could not enable screen curtain")
Sorry if I'm missing something.
My tests are successful toggling screen curtain, so I can't check
what happens when this can't be done.