Fixed some misbehaviours regarding question() + added #import functionality when restoring

This commit is contained in:
2020-09-23 20:08:15 +02:00
parent 17c74d3808
commit eeeed0f110
20 changed files with 164 additions and 83 deletions
@@ -36,10 +36,12 @@ class PrepareEvalQuestionEvaluator(OneReturnValueEvaluator):
self.name,
True, sheerka.new(BuiltinConcepts.USER_INPUT, body=self.question, user_name=context.event.user_id))
root = context.get_parents(lambda ec: ec.action == BuiltinConcepts.PROCESS_INPUT)
root = context.get_parents(lambda ec: ec.action in (BuiltinConcepts.EVALUATING_CONCEPT,
BuiltinConcepts.PROCESS_INPUT))
root = root[0] if root else context
root.protected_hints.add(BuiltinConcepts.EVAL_QUESTION_REQUESTED)
root.protected_hints.add(BuiltinConcepts.EVAL_BODY_REQUESTED)
root.protected_hints.add(BuiltinConcepts.RETURN_BODY_REQUESTED)
root.add_to_protected_hints(BuiltinConcepts.EVAL_QUESTION_REQUESTED)
root.add_to_protected_hints(BuiltinConcepts.EVAL_UNTIL_SUCCESS_REQUESTED)
root.add_to_protected_hints(BuiltinConcepts.EVAL_BODY_REQUESTED)
root.add_to_protected_hints(BuiltinConcepts.RETURN_BODY_REQUESTED)
return new_text_to_parse