pygcam.mcs.XML

API

class pygcam.mcs.XML.XMLWrapper(element)

A simple wrapper around any ElementTree element.

pygcam.mcs.XML.findAndSave(elt, eltName, cls, myDict, tree=None, testFunc=None, parent=None)

Simple helper function to find elements with a given name, create a wrapper instance and store them in the given dictionary.

pygcam.mcs.XML.getBooleanXML(value)

Get a value from an XML file and convert it into a boolean True or False.

Parameters:value – any value (it’s first converted to a string)
Returns:True of the value is in [‘true’, ‘1’], False if the value is in [‘false’, ‘0’]. An exception is raised if any other value is passed.
Raises:PygcamException