comparison orpg/mapper/miniatures_msg.py @ 228:24769389a7ba alpha

Traipse Alpha 'OpenRPG' {100612-01} Traipse is a distribution of OpenRPG that is designed to be easy to setup and go. Traipse also makes it easy for developers to work on code without fear of sacrifice. 'Ornery-Orc' continues the trend of 'Grumpy' and adds fixes to the code. 'Ornery-Orc's main goal is to offer more advanced features and enhance the productivity of the user. Update Summary (Preparing to close updates) New Features: New to Map, can re-order Grid, Miniatures, and Whiteboard layer draw order Fixes: Fix to InterParse that was causing an Infernal Loop with Namespace Internal Fix to XML data, removed old Minidom and switched to Element Tree Fix to Server that was causing eternal attempt to find a Server ID, in Register Rooms thread Fix to metaservers.xml file not being created
author sirebral
date Sat, 12 Jun 2010 04:38:29 -0500
parents b633f4c64aae
children
comparison
equal deleted inserted replaced
225:2c6db2043764 228:24769389a7ba
77 self.tagname = "miniatures" 77 self.tagname = "miniatures"
78 map_element_msg_base.__init__(self,reentrant_lock_object) 78 map_element_msg_base.__init__(self,reentrant_lock_object)
79 79
80 def init_from_dom(self,xml_dom): 80 def init_from_dom(self,xml_dom):
81 self.p_lock.acquire() 81 self.p_lock.acquire()
82 if xml_dom.tagName == self.tagname: 82 if xml_dom.tag == self.tagname:
83 if xml_dom.getAttributeKeys(): 83 if xml_dom.keys():
84 for k in xml_dom.getAttributeKeys(): self.init_prop(k,xml_dom.getAttribute(k)) 84 for k in xml_dom.keys(): self.init_prop(k,xml_dom.get(k))
85 85
86 for c in xml_dom._get_childNodes(): 86 for c in xml_dom.getchildren():
87 mini = mini_msg(self.p_lock) 87 mini = mini_msg(self.p_lock)
88 try: mini.init_from_dom(c) 88 try: mini.init_from_dom(c)
89 except Exception, e: print e; continue 89 except Exception, e: print e; continue
90 id = mini.get_prop("id") 90 id = mini.get_prop("id")
91 action = mini.get_prop("action") 91 action = mini.get_prop("action")
101 raise Exception, "Error attempting to initialize a " + self.tagname + " from a non-<" + self.tagname + "/> element" 101 raise Exception, "Error attempting to initialize a " + self.tagname + " from a non-<" + self.tagname + "/> element"
102 self.p_lock.release() 102 self.p_lock.release()
103 103
104 def set_from_dom(self,xml_dom): 104 def set_from_dom(self,xml_dom):
105 self.p_lock.acquire() 105 self.p_lock.acquire()
106 if xml_dom.tagName == self.tagname: 106 if xml_dom.tag == self.tagname:
107 if xml_dom.getAttributeKeys(): 107 if xml_dom.keys():
108 for k in xml_dom.getAttributeKeys(): self.set_prop(k,xml_dom.getAttribute(k)) 108 for k in xml_dom.keys(): self.set_prop(k,xml_dom.get(k))
109 for c in xml_dom._get_childNodes(): 109 for c in xml_dom.getchildren():
110 mini = mini_msg(self.p_lock) 110 mini = mini_msg(self.p_lock)
111 try: mini.set_from_dom(c) 111 try: mini.set_from_dom(c)
112 except Exception, e: print e; continue 112 except Exception, e: print e; continue
113 id = mini.get_prop("id") 113 id = mini.get_prop("id")
114 action = mini.get_prop("action") 114 action = mini.get_prop("action")