Esempio n. 1
0
 def to_dict(self):
     '''Save this location into a dictionary.'''
     return {'x': self.x,
             'y': self.y,
             'height': self.height,
             'width': self.width,
             'direction': dir.to_string(self.direction)}
Esempio n. 2
0
 def to_dict(self):
     '''Save this location into a dictionary.'''
     return {
         'x': self.x,
         'y': self.y,
         'height': self.height,
         'width': self.width,
         'direction': dir.to_string(self.direction)
     }
Esempio n. 3
0
 def save_xml(self, doc, element):
     '''Save this location into an xml.dom.Element object.'''
     element.setAttributeNS(RTS_EXT_NS, RTS_EXT_NS_S + 'x', str(self.x))
     element.setAttributeNS(RTS_EXT_NS, RTS_EXT_NS_S + 'y', str(self.y))
     element.setAttributeNS(RTS_EXT_NS, RTS_EXT_NS_S + 'height',
                            str(self.height))
     element.setAttributeNS(RTS_EXT_NS, RTS_EXT_NS_S + 'width',
                            str(self.width))
     element.setAttributeNS(RTS_EXT_NS, RTS_EXT_NS_S + 'direction',
                            dir.to_string(self.direction).lower())
Esempio n. 4
0
 def save_xml(self, doc, element):
     '''Save this location into an xml.dom.Element object.'''
     element.setAttributeNS(RTS_EXT_NS, RTS_EXT_NS_S + 'x', str(self.x))
     element.setAttributeNS(RTS_EXT_NS, RTS_EXT_NS_S + 'y', str(self.y))
     element.setAttributeNS(RTS_EXT_NS, RTS_EXT_NS_S + 'height',
                            str(self.height))
     element.setAttributeNS(RTS_EXT_NS, RTS_EXT_NS_S + 'width',
                            str(self.width))
     element.setAttributeNS(RTS_EXT_NS, RTS_EXT_NS_S + 'direction',
                            dir.to_string(self.direction).lower())
Esempio n. 5
0
 def __str__(self):
     return 'Position: {0}, {1}\nSize: {2}x{3}\nDirection: {4}'.format(\
             self.x, self.y, self.width, self.height,
             dir.to_string(self.direction))
Esempio n. 6
0
 def __str__(self):
     return 'Position: {0}, {1}\nSize: {2}x{3}\nDirection: {4}'.format(\
             self.x, self.y, self.width, self.height,
             dir.to_string(self.direction))