def export_one(element, attribs): tree = ElementTree.Element("backend") tree = Role.export_one(tree, element, attribs) if "master" in attribs or attribs == "all": attrib = ElementTree.SubElement(tree, "master") if element.master != None: if element.master == True: attrib.text = "True" else: attrib.text = "False" return ElementTree.tostring(tree, "UTF-8")
def export_one(element, attribs): tree = ElementTree.Element("user") tree = Role.export_one(tree, element, attribs) if "room" in attribs or attribs == "all": attrib = ElementTree.SubElement(tree, "room") if element.room != None: attrib.text = element.room.name if "receive_room" in attribs or attribs == "all": attrib = ElementTree.SubElement(tree, "receive_room") if element.receive_room != None: attrib.text = element.receive_room.name if "admin" in attribs or attribs == "all": attrib = ElementTree.SubElement(tree, "admin") if element.admin != None: if element.admin == True: attrib.text = "True" else: attrib.text = "False" return ElementTree.tostring(tree, "UTF-8")
def export_one(element, attribs): tree = ElementTree.Element("node") tree = Role.export_one(tree, element, attribs) if "room" in attribs or attribs == "all": attrib = ElementTree.SubElement(tree, "room") if element.room != None: attrib.text = element.room.name if "title" in attribs or attribs == "all": attrib = ElementTree.SubElement(tree, "title") attrib.text = element.title if "type" in attribs or attribs == "all": attrib = ElementTree.SubElement(tree, "type") attrib.text = element.type if "input" in attribs or attribs == "all": attrib = ElementTree.SubElement(tree, "input") attrib.text = element.input if "output" in attribs or attribs == "all": attrib = ElementTree.SubElement(tree, "output") attrib.text = element.output return ElementTree.tostring(tree, "UTF-8")
def export_one(element, attribs): tree = ElementTree.Element("monitor") tree = Role.export_one(tree, element, attribs) return ElementTree.tostring(tree, "UTF-8")