git://git.onelab.eu
/
sfa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
a0f6a0a
)
fix error with datetime structs in parse_dict
author
smbaker
<smbaker@fc8clean.lan>
Mon, 31 Oct 2011 01:54:11 +0000
(18:54 -0700)
committer
smbaker
<smbaker@fc8clean.lan>
Mon, 31 Oct 2011 01:54:11 +0000
(18:54 -0700)
sfa/util/xml.py
[changed mode: 0755->0644]
patch
|
blob
|
history
diff --git
a/sfa/util/xml.py
b/sfa/util/xml.py
old mode 100755
(executable)
new mode 100644
(file)
index
78e4c6a
..
89eef9e
--- a/
sfa/util/xml.py
+++ b/
sfa/util/xml.py
@@
-96,8
+96,15
@@
class XML:
elif isinstance(value, int):
d[key] = unicode(d[key])
elif value is None:
- d.pop(key)
-
+ d.pop(key)
+
+ # element.attrib.update will explode if DateTimes are in the
+ # dcitionary.
+ d=d.copy()
+ for k in d.keys():
+ if (type(d[k]) != str) and (type(d[k]) != unicode):
+ del d[k]
+
element.attrib.update(d)
def validate(self, schema):