comparison orpg/mapper/base_msg.py @ 236:9230a33defd9 beta

Traipse Beta 'OpenRPG' {100616-00} 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 (Closing/Closed) New Features: New to Map, can re-order Grid, Miniatures, and Whiteboard layer draw order New to Server GUI, can now clear log Updates: Update to Warhammer PC Sheet. Rollers set as macros. Should work with little maintanence. Update to Browser Server window. Display rooms with ' " & cleaner Update to Server. Handles ' " & cleaner. 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 Fix to Single and Double quotes in Whiteboard text Fix to Background images not showing when using the Image Server Fix to Duplicate chat names appearing Fix to Server GUI's logging output Fix to FNB.COLORFUL_TABS bug.
author sirebral
date Wed, 16 Jun 2010 03:06:20 -0500
parents dcae32e219f1
children
comparison
equal deleted inserted replaced
226:b29454610f36 236:9230a33defd9
27 # 27 #
28 __version__ = "$Id: base_msg.py,v Traipse 'Ornery-Orc' prof.ebral Exp $" 28 __version__ = "$Id: base_msg.py,v Traipse 'Ornery-Orc' prof.ebral Exp $"
29 29
30 from threading import RLock 30 from threading import RLock
31 from orpg.networking.mplay_client import * 31 from orpg.networking.mplay_client import *
32 from xml.etree.ElementTree import ElementTree, Element 32 from xml.etree.ElementTree import ElementTree, Element, fromstring
33 33
34 class map_element_msg_base: 34 class map_element_msg_base:
35 # This is a base class 35 # This is a base class
36 36
37 def __init__(self,reentrant_lock_object = None): 37 def __init__(self,reentrant_lock_object = None):
214 def set_from_dom(self,xml_dom): 214 def set_from_dom(self,xml_dom):
215 # xml_dom must be pointing to an empty tag. Override in a derived class for <map/> and other similar tags 215 # xml_dom must be pointing to an empty tag. Override in a derived class for <map/> and other similar tags
216 self._from_dom(xml_dom,self.set_prop) 216 self._from_dom(xml_dom,self.set_prop)
217 217
218 def init_from_xml(self,xml): 218 def init_from_xml(self,xml):
219 xml_dom = parseXml(xml) 219 #xml_dom = parseXml(xml)
220 node_list = xml_dom.getElementsByTagName(self.tagname) 220 xml_dom = fromstring(xml)
221 #node_list = xml_dom.getElementsByTagName(self.tagname)
222 node_list = xml_dom.findall(self.tagname)
221 if len(node_list) < 1: print "Warning: no <" + self.tagname + "/> elements found in DOM." 223 if len(node_list) < 1: print "Warning: no <" + self.tagname + "/> elements found in DOM."
222 else: 224 else:
223 while len(node_list): self.init_from_dom(node_list.pop()) 225 while len(node_list): self.init_from_dom(node_list.pop())
224 if xml_dom: xml_dom.unlink() 226 #if xml_dom: xml_dom.unlink()
225 227
226 def set_from_xml(self,xml): 228 def set_from_xml(self,xml):
227 xml_dom = parseXml(xml) 229 #xml_dom = parseXml(xml)
228 node_list = xml_dom.getElementsByTagName(self.tagname) 230 xml_dom = fromstring(xml)
231 #node_list = xml_dom.getElementsByTagName(self.tagname)
232 node_list = xml_dom.findall(self.tagname)
229 if len(node_list) < 1: print "Warning: no <" + self.tagname + "/> elements found in DOM." 233 if len(node_list) < 1: print "Warning: no <" + self.tagname + "/> elements found in DOM."
230 else: 234 else:
231 while len(node_list): self.set_from_dom(node_list.pop()) 235 while len(node_list): self.set_from_dom(node_list.pop())
232 if xml_dom: xml_dom.unlink() 236 #if xml_dom: xml_dom.unlink()
233 237
234 # XML importers end 238 # XML importers end
235 ######################################### 239 #########################################