def to_xml_str(self, pretty_print=False): attr = {} if self.version: attr[SDX_SUNSPEC_DATA_VERSION] = self.version self.root = ET.Element(SDX_SUNSPEC_DATA, attrib=attr) for d in self.device_data: d.to_xml(self.root) if pretty_print: util.indent(self.root) return ET.tostring(self.root)
def to_xml_str(self, pretty_print=False): attr = {} if self.version: attr[SDX_SUNSPEC_DATA_VERSION] = self.version self.root = ET.Element(SDX_SUNSPEC_DATA, attrib=attr) for d in self.device_data: d.to_xml(self.root) if pretty_print: util.indent(self.root) out = ET.tostring(self.root) if sys.version_info > (3, ): temp = "" for i in out: temp += chr(i) out = temp return out
def to_xml_str(self, pretty_print=False): attr = {} if self.version: attr[SDX_SUNSPEC_DATA_VERSION] = self.version self.root = ET.Element(SDX_SUNSPEC_DATA, attrib=attr) for d in self.device_data: d.to_xml(self.root) if pretty_print: util.indent(self.root) out = ET.tostring(self.root) if sys.version_info > (3,): temp = "" for i in out: temp += chr(i) out = temp return out