@contextlib.contextmanager<EOL><INDENT>def _execution(self):<DEDENT>
did_start_executing = False<EOL>if self.state == STATE_DEFAULT:<EOL><INDENT>did_start_executing = True<EOL>self.state = STATE_EXECUTING<EOL><DEDENT>def close():<EOL><INDENT>if did_start_executing and self.state == STATE_EXECUTING:<EOL><INDENT>self.state = STATE_DEFAULT<EOL><DEDENT><DEDENT>yield close<EOL>close()<EOL>
Context manager for executing some JavaScript inside a template.