1
0
Fork 0

In DATAS, attribute stated by _ are ignored

This commit is contained in:
Némunaire 2012-09-01 15:50:24 +02:00
parent 387ecc7d5c
commit 07863d0718
1 changed files with 5 additions and 4 deletions

View File

@ -148,10 +148,11 @@ class ModuleState:
"""Serialize this node as a XML node"""
attribs = {}
for att in self.attributes.keys():
if isinstance(self.attributes[att], datetime):
attribs[att] = str(time.mktime(self.attributes[att].timetuple()))
else:
attribs[att] = str(self.attributes[att])
if att[0] != "_": # Don't save attribute starting by _
if isinstance(self.attributes[att], datetime):
attribs[att] = str(time.mktime(self.attributes[att].timetuple()))
else:
attribs[att] = str(self.attributes[att])
attrs = xml.sax.xmlreader.AttributesImpl(attribs)
gen.startElement(self.name, attrs)