Exemplo n.º 1
0
 def validate(self):
     ans = super(RuleEdit, self).validate()
     if ans:
         rule = self.rule
         if 'glob' in rule['match_type']:
             try:
                 compile_glob(rule['query'])
             except Exception:
                 error_dialog(self, _('Query invalid'), _(
                     '%s is not a valid glob expression') % rule['query'], show=True)
                 return False
     return ans
Exemplo n.º 2
0
 def validate(self):
     ans = super().validate()
     if ans:
         rule = self.rule
         if 'glob' in rule['match_type']:
             try:
                 compile_glob(rule['query'])
             except Exception:
                 error_dialog(self, _('Query invalid'), _(
                     '%s is not a valid glob expression') % rule['query'], show=True)
                 return False
     return ans