def _validate_get_failure(self): if self.event_type_condition.get_active(): if self.event_type_op.get_active() == -1: return (_("No operator was selected"), None, self.event_type_op) try: util.parse_msgtype(self.event_type_value.child.get_text()) except ParsingError, e: return (str(e), None, self.event_type_value)
def _save_rule(self, rule): """Modify rule to reflect dialog state.""" del rule.fields[:] if self.event_type_condition.get_active(): f = Field() f.var = audit.AUDIT_MSGTYPE f.op = self.op_store.get_value(self.event_type_op.get_active_iter(), 0) try: f.value = util.parse_msgtype(self.event_type_value.child.get_text()) except ParsingError: assert False, "Should have been validated" rule.fields.append(f)
def parse_value(string, *_): return util.parse_msgtype(string)