487 |
|
|
488 |
def _boolfromValue(doc): |
def _boolfromValue(doc): |
489 |
return bool(doc.nodeValue.strip()) |
return bool(doc.nodeValue.strip()) |
490 |
|
|
491 |
|
def _nonefromValue(doc): |
492 |
|
return None |
493 |
|
|
494 |
# Mapping from text types in the xml to methods used to process trees of that type |
# Mapping from text types in the xml to methods used to process trees of that type |
495 |
ptypemap = {"Simulation": Simulation.fromDom, |
ptypemap = {"Simulation": Simulation.fromDom, |
500 |
"int":_intfromValue, |
"int":_intfromValue, |
501 |
"str":_stringfromValue, |
"str":_stringfromValue, |
502 |
"bool":_boolfromValue |
"bool":_boolfromValue |
503 |
|
"NoneType":_nonefromValue, |
504 |
} |
} |
505 |
|
|
506 |
# print doc.toxml() |
# print doc.toxml() |