git://git.onelab.eu
/
sfa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
a bit more pythonic
[sfa.git]
/
sfa
/
util
/
xml.py
diff --git
a/sfa/util/xml.py
b/sfa/util/xml.py
index
8f51ce3
..
25f1656
100755
(executable)
--- a/
sfa/util/xml.py
+++ b/
sfa/util/xml.py
@@
-1,4
+1,5
@@
#!/usr/bin/python
#!/usr/bin/python
+from types import StringTypes
from lxml import etree
from StringIO import StringIO
from lxml import etree
from StringIO import StringIO
@@
-101,6
+102,8
@@
class XML:
# element.attrib.update will explode if DateTimes are in the
# dcitionary.
d=d.copy()
# element.attrib.update will explode if DateTimes are in the
# dcitionary.
d=d.copy()
+ for (k,v) in d.iteritems():
+ if not isinstance(v,StringTypes): del d[k]
for k in d.keys():
if (type(d[k]) != str) and (type(d[k]) != unicode):
del d[k]
for k in d.keys():
if (type(d[k]) != str) and (type(d[k]) != unicode):
del d[k]