def set_constraint_el_to_string(constraint_el, showDetail=False): set_list = [] for set_el in constraint_el.getElementsByTagName("resource_set"): set_list.append("set " + " ".join( [ res_el.getAttribute("id") for res_el in set_el.getElementsByTagName("resource_ref") ] + utils.dom_attrs_to_list(set_el, showDetail) )) constraint_opts = utils.dom_attrs_to_list(constraint_el, False) if constraint_opts: constraint_opts.insert(0, "setoptions") if showDetail: constraint_opts.append("(id:%s)" % constraint_el.getAttribute("id")) return " ".join(set_list + constraint_opts)
def list_attributes(self, element): attributes = utils.dom_attrs_to_list(element, with_id=False) # sort it always to get the same output for the same input as dict is # unordered attributes.sort() return attributes
def list_attributes(self, element): attributes = utils.dom_attrs_to_list(element, with_id=False) if self.show_detail: attributes.append(" (id:%s)" % (element.getAttribute("id"))) return attributes
def _list_attributes(element): attributes = utils.dom_attrs_to_list(element, with_id=False) # sort it always to get the same output for the same input as dict is # unordered attributes.sort() return attributes
def _list_attributes(self, element): attributes = utils.dom_attrs_to_list(element, with_id=False) if self.show_detail: attributes.append("(id:%s)" % (element.getAttribute("id"))) return attributes