def normalize(constraint_el): return ( constraint_el.getAttribute("rsc"), [ rule_utils.ExportAsExpression().get_string(rule_el, True) for rule_el in constraint_el.getElementsByTagName("rule") ] )
def normalize(constraint_el): if constraint_el.hasAttribute("rsc-pattern"): rsc = (RESOURCE_TYPE_REGEXP, constraint_el.getAttribute("rsc-pattern")) else: rsc = (RESOURCE_TYPE_RESOURCE, constraint_el.getAttribute("rsc")) return (rsc, [ rule_utils.ExportAsExpression().get_string(rule_el, True) for rule_el in constraint_el.getElementsByTagName("rule") ])