def on_message(self, text): dict_key = self.kwargs.get("key", "name") if text != "Назад": self.deferred.callback( ActivityReturn(ActivityReturn.ReturnType.OK, {dict_key: text})) return Activity.on_message(self, text)
def on_message(self, text): field_type = self.kwargs.get("field_type", "str") if text != "Назад": value = None if field_type == "str": value = text elif field_type == "int" and FieldEdit.is_int(text): value = int(text) elif field_type == "bool" and FieldEdit.is_bool(text): value = {"Да": True, "Нет": False}[text] if value is not None: self.deferred.callback(ActivityReturn(ActivityReturn.ReturnType.OK, {"value": value})) return Activity.on_message(self, text)
def on_message(self, text): field_type = self.kwargs.get("field_type", "str") if text != "Назад": value = None if field_type == "str": value = text elif field_type == "int" and FieldEdit.is_int(text): value = int(text) elif field_type == "bool" and FieldEdit.is_bool(text): value = {"Да": True, "Нет": False}[text] if value is not None: self.deferred.callback( ActivityReturn(ActivityReturn.ReturnType.OK, {"value": value})) return Activity.on_message(self, text)
def on_message(self, text): dict_key = self.kwargs.get("key", "name") if text != "Назад": self.deferred.callback(ActivityReturn(ActivityReturn.ReturnType.OK, {dict_key: text})) return Activity.on_message(self, text)