From 83c1e26a791e151cfcfef37d76444ba66f40697f Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Mon, 31 Oct 2011 09:35:30 -0400 Subject: [PATCH] updated Xml.todict() --- sfa/util/record.py | 2 +- sfa/util/xml.py | 14 +------------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/sfa/util/record.py b/sfa/util/record.py index 424f4195..7ebf379a 100644 --- a/sfa/util/record.py +++ b/sfa/util/record.py @@ -319,7 +319,7 @@ class SfaRecord(Row): #dict = xmlrpclib.loads(str)[0][0] record = XML(str) - self.load_from_dict(record.todict2()) + self.load_from_dict(record.todict()) ## # Dump the record to stdout diff --git a/sfa/util/xml.py b/sfa/util/xml.py index d880ed3c..0ef71d96 100755 --- a/sfa/util/xml.py +++ b/sfa/util/xml.py @@ -216,20 +216,8 @@ class XML: def toxml(self): return etree.tostring(self.root, encoding='UTF-8', pretty_print=True) - def todict(self, elem=None): - if elem is None: - elem = self.root - d = {} - d.update(elem.attrib) - d['text'] = elem.text - for child in elem.iterchildren(): - if child.tag not in d: - d[child.tag] = [] - d[child.tag].append(self.todict(child)) - return d - # XXX smbaker, for record.load_from_string - def todict2(self, elem=None): + def todict(self, elem=None): if elem is None: elem = self.root d = {} -- 2.43.0