def parse_yaml(self, y): '''Parse a YAML specification of a location into this object.''' self.x = int(y['x']) self.y = int(y['y']) self.height = int(y['height']) self.width = int(y['width']) self.direction = dir.from_string(y['direction']) return self
def parse_xml_node(self, node): '''Parse an xml.dom Node object representing a location into this object. ''' self.x = int(node.getAttributeNS(RTS_EXT_NS, 'x')) self.y = int(node.getAttributeNS(RTS_EXT_NS, 'y')) self.height = int(node.getAttributeNS(RTS_EXT_NS, 'height')) self.width = int(node.getAttributeNS(RTS_EXT_NS, 'width')) self.direction = dir.from_string(node.getAttributeNS(RTS_EXT_NS, 'direction')) return self
def parse_xml_node(self, node): '''Parse an xml.dom Node object representing a location into this object. ''' self.x = int(node.getAttributeNS(RTS_EXT_NS, 'x')) self.y = int(node.getAttributeNS(RTS_EXT_NS, 'y')) self.height = int(node.getAttributeNS(RTS_EXT_NS, 'height')) self.width = int(node.getAttributeNS(RTS_EXT_NS, 'width')) self.direction = dir.from_string( node.getAttributeNS(RTS_EXT_NS, 'direction')) return self