Beispiel #1
0
 def check(self):
     for clause in self._ruleorder:
         for rulename in clause:
             if not self.is_rule(rulename):
                 raise UnknownRuleException(
                     rulename, prefix="Error in ruleorder definition."
                 )
Beispiel #2
0
    def get_rule(self, name):
        """
        Get rule by name.

        Arguments
        name -- the name of the rule
        """
        if not self._rules:
            raise NoRulesException()
        if not name in self._rules:
            raise UnknownRuleException(name)
        return self._rules[name]