changeset 139:8e07c1a2c69b alpha

Traipse Alpha 'OpenRPG' {091123-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 (Cleaning up for Beta) Added Bookmarks Fix to Remote Admin Commands Minor fix to text based Server Fix to Pretty Print, from Core Fix to Splitter Nodes not being created Fix to massive amounts of images loading, from Core Added 'boot' command to remote admin Added confirmation window for sent nodes Minor changes to allow for portability to an OpenSUSE linux OS Miniatures Layer pop up box allows users to turn off Mini labels, from FlexiRPG Zoom Mouse plugin added Images added to Plugin UI Switching to Element Tree Map efficiency, from FlexiRPG Added Status Bar to Update Manager default_manifest.xml renamed to default_upmana.xml Cleaner clode for saved repositories New TrueDebug Class in orpg_log (See documentation for usage) Mercurial's hgweb folder is ported to upmana Pretty important update that can help remove thousands of dead children from your gametree. Children, <forms />, <group_atts />, <horizontal />, <cols />, <rows />, <height />, etc... are all tags now. Check your gametree and look for dead children!! New Gametree Recursion method, mapping, and context sensitivity. !Infinite Loops return error instead of freezing the software! New Syntax added for custom PC sheets Tip of the Day added, from Core and community Fixed Whiteboard ID to prevent random line or text deleting. Modified ID's to prevent non updated clients from ruining the fix.
author sirebral
date Mon, 23 Nov 2009 03:22:50 -0600
parents 1ed2feab0db9
children 2ffc5de126c8
files orpg/mapper/background.py orpg/mapper/background_msg.py orpg/mapper/base_msg.py orpg/mapper/fog.py orpg/mapper/fog_msg.py orpg/mapper/grid.py orpg/mapper/grid_msg.py orpg/mapper/images.py orpg/mapper/map.py orpg/mapper/map_msg.py orpg/mapper/miniatures.py orpg/mapper/miniatures_msg.py orpg/mapper/whiteboard.py orpg/mapper/whiteboard_handler.py orpg/mapper/whiteboard_msg.py orpg/networking/gsclient.py orpg/networking/mplay_server.py orpg/networking/mplay_server_gui.py orpg/orpg_version.py orpg/plugindb.py upmana/manifest.py
diffstat 21 files changed, 481 insertions(+), 515 deletions(-) [+]
line wrap: on
line diff
--- a/orpg/mapper/background.py	Sat Nov 21 03:19:34 2009 -0600
+++ b/orpg/mapper/background.py	Mon Nov 23 03:22:50 2009 -0600
@@ -40,8 +40,6 @@
 from orpg.tools.decorators import debugging
 from orpg.tools.orpg_settings import settings
 
-from xml.etree.ElementTree import ElementTree, Element, tostring, fromstring, parse
-
 ##-----------------------------
 ## background layer
 ##-----------------------------
@@ -102,7 +100,7 @@
         self.type = BG_TEXTURE
         if self.img_path != path:
             try:
-                self.bg_bmp = ImageHandler.load(path, "texture", 0)
+                self.bg_bmp = ImageHandler.load(path, "texture", 0).ConvertToBitmap()
                 if self.bg_bmp == None:
                     logger.general("Invalid image type!")
                     raise Exception, "Invalid image type!"
@@ -114,7 +112,7 @@
         self.isUpdated = True
         self.type = BG_IMAGE
         if self.img_path != path:
-            self.bg_bmp = ImageHandler.load(path, "background", 0)
+            self.bg_bmp = ImageHandler.load(path, "background", 0).ConvertToBitmap()
             try:
                 if self.bg_bmp == None:
                     logger.general("Invalid image type!")
@@ -136,12 +134,6 @@
         if self.bg_bmp == None or not self.bg_bmp.Ok() or ((self.type != BG_TEXTURE) and (self.type != BG_IMAGE)):
             return False
         dc2 = wx.MemoryDC()
-        
-        ### Temporary ###
-        try: self.bg_bmp = self.bg_bmp.ConvertToBitmap()
-        except: pass
-        #################
-        
         dc2.SelectObject(self.bg_bmp)
         topLeft = [int(topleft[0]/scale), int(topleft[1]/scale)]
         topRight = [int((topleft[0]+size[0]+1)/scale)+1, int((topleft[1]+size[1]+1)/scale)+1]
@@ -214,52 +206,55 @@
 
 
     def layerToXML(self, action="update"):
-        xml = Element('bg')
+        xml_str = "<bg"
         if self.bg_color != None:
             (red,green,blue) = self.bg_color.Get()
             hexcolor = self.r_h.hexstring(red, green, blue)
-            xml.set('color', hexcolor)
-        if self.img_path != None: xml.set('path', urllib.quote(self.img_path).replace('%3A', ':'))
-        if self.type != None: xml.set('type', str(self.type))
+            xml_str += ' color="' + hexcolor + '"'
+        if self.img_path != None: xml_str += ' path="' + urllib.quote(self.img_path).replace('%3A', ':') + '"'
+        if self.type != None: xml_str += ' type="' + str(self.type) + '"'
         if self.local and self.img_path != None:
-            xml.set('local', 'True')
-            xml.set('localPath', urllib.quote(self.localPath).replace('%3A', ':'))
-            xml.set('localTime', str(self.localTime))
+            xml_str += ' local="True"'
+            xml_str += ' localPath="' + urllib.quote(self.localPath).replace('%3A', ':') + '"'
+            xml_str += ' localTime="' + str(self.localTime) + '"'
+        xml_str += "/>"
+        logger.debug(xml_str)
         if (action == "update" and self.isUpdated) or action == "new":
             self.isUpdated = False
-            return tostring(xml)
+            return xml_str
         else: return ''
 
 
     def layerTakeDOM(self, xml_dom):
         type = BG_COLOR
-        color = xml_dom.get("color")
+        color = xml_dom.getAttribute("color")
+        logger.debug("color=" + color)
+        path = urllib.unquote(xml_dom.getAttribute("path"))
+        logger.debug("path=" + path)
         # Begin ted's map changes
-        if xml_dom.get("color"):
-            r,g,b = self.r_h.rgb_tuple(xml_dom.get("color"))
+        if xml_dom.hasAttribute("color"):
+            r,g,b = self.r_h.rgb_tuple(xml_dom.getAttribute("color"))
             self.set_color(cmpColour(r,g,b))
         # End ted's map changes
-        if xml_dom.get("type"):
-            type = int(xml_dom.get("type"))
+        if xml_dom.hasAttribute("type"):
+            type = int(xml_dom.getAttribute("type"))
             logger.debug("type=" + str(type))
-        if type == BG_TEXTURE: 
-            if xml_dom.get('path') != "": self.set_texture(xml_dom.get('path'))
-        elif type == BG_IMAGE: 
-            if xml_dom.get('path') != "": self.set_image(xml_dom.get('path'), 1)
+        if type == BG_TEXTURE:
+            if path != "": self.set_texture(path)
+        elif type == BG_IMAGE:
+            if path != "": self.set_image(path, 1)
         elif type == BG_NONE: self.clear()
-        if xml_dom.get('local') and xml_dom.get('local') == 'True' and os.path.exists(urllib.unquote(xml_dom.get('localPath'))):
-            self.localPath = urllib.unquote(xml_dom.get('localPath'))
+        if xml_dom.hasAttribute('local') and xml_dom.getAttribute('local') == 'True' and os.path.exists(urllib.unquote(xml_dom.getAttribute('localPath'))):
+            self.localPath = urllib.unquote(xml_dom.getAttribute('localPath'))
             self.local = True
-            self.localTime = int(xml_dom.get('localTime'))
+            self.localTime = int(xml_dom.getAttribute('localTime'))
             if self.localTime-time.time() <= 144000:
                 file = open(self.localPath, "rb")
                 imgdata = file.read()
                 file.close()
                 filename = os.path.split(self.localPath)
                 (imgtype,j) = mimetypes.guess_type(filename[1])
-                postdata = urllib.urlencode({'filename':filename[1], 
-                                            'imgdata':imgdata, 
-                                            'imgtype':imgtype})
+                postdata = urllib.urlencode({'filename':filename[1], 'imgdata':imgdata, 'imgtype':imgtype})
                 thread.start_new_thread(self.upload, (postdata, self.localPath, type))
 
 
@@ -267,12 +262,13 @@
         self.lock.acquire()
         if type == 'Image' or type == 'Texture':
             url = component.get('settings').get_setting('ImageServerBaseURL')
-            recvdata = parse(urllib.urlopen(url, postdata))
+            file = urllib.urlopen(url, postdata)
+            recvdata = file.read()
+            file.close()
             try:
-                xml_dom = fromstring(recvdata).getroot()
-                xml_dom = fromstring(recvdata)
-                if xml_dom.tag == 'path':
-                    path = xml_dom.get('url')
+                xml_dom = minidom.parseString(recvdata)._get_documentElement()
+                if xml_dom.nodeName == 'path':
+                    path = xml_dom.getAttribute('url')
                     path = urllib.unquote(path)
                     if type == 'Image': self.set_image(path, 1)
                     else: self.set_texture(path)
@@ -280,7 +276,7 @@
                     self.local = True
                     self.localTime = time.time()
                 else:
-                    print xml_dom.get('msg')
+                    print xml_dom.getAttribute('msg')
             except Exception, e:
                 print e
                 print recvdata
--- a/orpg/mapper/background_msg.py	Sat Nov 21 03:19:34 2009 -0600
+++ b/orpg/mapper/background_msg.py	Mon Nov 23 03:22:50 2009 -0600
@@ -27,8 +27,7 @@
 #
 __version__ = "$Id: background_msg.py,v 1.8 2006/11/04 21:24:21 digitalxero Exp $"
 
-from base_msg import map_element_msg_base
-from xml.etree.ElementTree import ElementTree
+from base_msg import *
 
 class bg_msg(map_element_msg_base):
 
--- a/orpg/mapper/base_msg.py	Sat Nov 21 03:19:34 2009 -0600
+++ b/orpg/mapper/base_msg.py	Mon Nov 23 03:22:50 2009 -0600
@@ -29,16 +29,15 @@
 
 from threading import RLock
 from orpg.networking.mplay_client import *
-
-from xml.etree.ElementTree import XML, fromstring, parse
+from xml.etree.ElementTree import ElementTree, Element
 
 class map_element_msg_base:
 #  This is a base class
 
     def __init__(self,reentrant_lock_object = None):
 
-        if not self.tagname:
-            raise Exception, "This is a virtual class that cannot be directly instantiated.  Set self.tagname in derived class."; exit()
+        if not hasattr(self,"tagname"):
+            raise Exception, "This is a virtual class that cannot be directly instantiated.  Set self.tagname in derived class."
 
         self._props = {}
         #  This is a dictionary that holds (value,changed) 2-tuples, indexed by attribute
@@ -197,38 +196,46 @@
     #########################################
     #  XML importers begin
 
-    def _from_dom(self,xml,prop_func):
+    def _from_dom(self,xml_dom,prop_func):
         self.p_lock.acquire()
-        if xml.tag == self.tagname:
-            if xml.keys():
-                for k in xml.keys():
-                    prop_func(k, xml.get(k))
+        if iselement(xml_dom): ## Uses new Element Tree style
+            if xml_dom.tag == self.tagname:
+                if xml_dom.attrib:
+                    for k in xml_dom.attrib:
+                        prop_func(k,xml_dom.get(k))
+        elif not iselement(xml_dom): ## Uses old DOM style (deprecated!!)
+            if xml_dom.tagName == self.tagname:
+                if xml_dom.getAttributeKeys():
+                    for k in xml_dom.getAttributeKeys():
+                        prop_func(k,xml_dom.getAttribute(k))
         else:
             self.p_lock.release()
             raise Exception, "Error attempting to modify a " + self.tagname + " from a non-<" + self.tagname + "/> element"
         self.p_lock.release()
 
-    def init_from_dom(self, xml):
-    #  xml must be pointing to an empty tag.  Override in a derived class for <map/> and other similar tags.
-        self._from_dom(xml,self.init_prop)
+    def init_from_dom(self,xml_dom):
+    #  xml_dom must be pointing to an empty tag.  Override in a derived class for <map/> and other similar tags.
+        self._from_dom(xml_dom,self.init_prop)
 
-    def set_from_dom(self, xml):
-    #  xml must be pointing to an empty tag.  Override in a derived class for <map/> and other similar tags
-        self._from_dom(xml, self.set_prop)
+    def set_from_dom(self,xml_dom):
+    #  xml_dom must be pointing to an empty tag.  Override in a derived class for <map/> and other similar tags
+        self._from_dom(xml_dom,self.set_prop)
 
-    def init_from_xml(self, tree):
-        #tree = XML(xmlString)
-        node_list = tree.findall(self.tagname)
+    def init_from_xml(self,xml):
+        xml_dom = parseXml(xml)
+        node_list = xml_dom.getElementsByTagName(self.tagname)
         if len(node_list) < 1: print "Warning: no <" + self.tagname + "/> elements found in DOM."
         else:
-            while len(node_list):
-                self.init_from_dom(node_list.pop())
+            while len(node_list): self.init_from_dom(node_list.pop())
+        if xml_dom: xml_dom.unlink()
 
-    def set_from_xml(self, tree):
-        #tree = XML(xmlString)
-        node_list = tree.findall(self.tagname)
+    def set_from_xml(self,xml):
+        xml_dom = parseXml(xml)
+        node_list = xml_dom.getElementsByTagName(self.tagname)
         if len(node_list) < 1: print "Warning: no <" + self.tagname + "/> elements found in DOM."
         else:
             while len(node_list): self.set_from_dom(node_list.pop())
+        if xml_dom: xml_dom.unlink()
+
     # XML importers end
     #########################################
--- a/orpg/mapper/fog.py	Sat Nov 21 03:19:34 2009 -0600
+++ b/orpg/mapper/fog.py	Mon Nov 23 03:22:50 2009 -0600
@@ -83,7 +83,6 @@
         self.log = component.get('log')
         layer_base.__init__(self)
         self.color = wx.Color(128, 128, 128)
-        #if "__WXGTK__" not in wx.PlatformInfo: self.color = wx.Color(128,128,128, 128)
         self.fogregion = wx.Region()
         self.fogregion.Clear()
         self.fog_bmp = None
@@ -122,8 +121,7 @@
         self.fill_fog()
 
     def fill_fog(self):
-        if not self.use_fog:
-            return
+        if not self.use_fog: return
         mdc = wx.MemoryDC()
         mdc.SelectObject(self.fog_bmp)
         mdc.SetPen(wx.TRANSPARENT_PEN)
@@ -144,7 +142,6 @@
         if self.fog_bmp == None or not self.fog_bmp.Ok() or not self.use_fog:
             return
         if self.last_role != self.canvas.frame.session.role: self.fill_fog()
-        
         mdc = wx.MemoryDC()
         mdc.SelectObject(self.fog_bmp)
         dc.Blit(0, 0, self.canvas.size[0], self.canvas.size[1], mdc, 0, 0, wx.AND)
@@ -184,14 +181,8 @@
         regn.Clear()
         list = IRegion().scan_Convert(polypt)
         for i in list:
-            if regn.IsEmpty():
-                #if "__WXGTK__" not in wx.PlatformInfo: 
-                regn = wx.Region(i.left*COURSE, i.y*COURSE, i.right*COURSE+1-i.left*COURSE, 1*COURSE)
-                #else: regn = wx.Region(i.left, i.y, i.right+1-i.left, 1)
-            else:
-                #if "__WXGTK__" not in wx.PlatformInfo: 
-                regn.Union(i.left*COURSE, i.y*COURSE, i.right*COURSE+1-i.left*COURSE, 1*COURSE)
-                #else: regn.Union(i.left, i.y, i.right+1-i.left, 1)
+            if regn.IsEmpty(): regn = wx.Region(i.left*COURSE, i.y*COURSE, i.right*COURSE+1-i.left*COURSE, 1*COURSE)
+            else: regn.Union(i.left*COURSE, i.y*COURSE, i.right*COURSE+1-i.left*COURSE, 1*COURSE)
         return regn
 
     def add_area(self, area="", show="Yes"):
@@ -209,21 +200,16 @@
         if show == "Yes": self.canvas.frame.session.send(xml_str)
 
     def layerToXML(self, action="update"):
-        if not self.use_fog: return ""
+        if not self.use_fog:
+            return ""
         fog_string = ""
         ri = wx.RegionIterator(self.fogregion)
         if not (ri.HaveRects()): fog_string = FogArea("all", self.log).toxml("del")
         while ri.HaveRects():
-            #if "__WXGTK__" not in wx.PlatformInfo:
             x1 = ri.GetX()/COURSE
             x2 = x1+(ri.GetW()/COURSE)-1
             y1 = ri.GetY()/COURSE
             y2 = y1+(ri.GetH()/COURSE)-1
-            #else:
-            #    x1 = ri.GetX()
-            #    x2 = x1+ri.GetW()-1
-            #    y1 = ri.GetY()
-            #    y2 = y1+ri.GetH()-1
             poly = FogArea(str(x1) + "," + str(y1) + ";" +
                           str(x2) + "," + str(y1) + ";" +
                           str(x2) + "," + str(y2) + ";" +
@@ -244,11 +230,11 @@
             if not self.use_fog:
                 self.use_fog = True
                 self.recompute_fog()
-            if xml_dom.get('serial'): self.serial_number = int(xml_dom.get('serial'))
-            children = xml_dom.getchildren()
+            if xml_dom.hasAttribute('serial'): self.serial_number = int(xml_dom.getAttribute('serial'))
+            children = xml_dom._get_childNodes()
             for l in children:
-                action = l.get("action")
-                outline = l.get("outline")
+                action = l.getAttribute("action")
+                outline = l.getAttribute("outline")
                 if (outline == "all"):
                     polyline = [IPoint().make(0,0), IPoint().make(self.width-1, 0),
                               IPoint().make(self.width-1, self.height-1),
@@ -261,10 +247,10 @@
                     polyline = []
                     lastx = None
                     lasty = None
-                    list = l.getchildren()
+                    list = l._get_childNodes()
                     for point in list:
-                        x = point.get( "x" )
-                        y = point.get( "y" )
+                        x = point.getAttribute( "x" )
+                        y = point.getAttribute( "y" )
                         if (x != lastx or y != lasty):
                             polyline.append(IPoint().make(int(x), int(y)))
                         lastx = x
--- a/orpg/mapper/fog_msg.py	Sat Nov 21 03:19:34 2009 -0600
+++ b/orpg/mapper/fog_msg.py	Mon Nov 23 03:22:50 2009 -0600
@@ -27,14 +27,13 @@
 
 from base_msg import *
 from region import *
-#from orpg.minidom import Element
+from orpg.minidom import Element
 import string
-from xml.etree.ElementTree import ElementTree
 
 class fog_msg(map_element_msg_base):
 
     def __init__(self,reentrant_lock_object = None):
-        self.tag = "fog"
+        self.tagname = "fog"
         map_element_msg_base.__init__(self,reentrant_lock_object)
         self.use_fog = 0
         self.fogregion=IRegion()
@@ -42,16 +41,16 @@
 
     def get_line(self,outline,action,output_act):
         elem = Element( "poly" )
-        if ( output_act ): elem.set( "action", action )
-        if ( outline == 'all' ) or ( outline == 'none' ): elem.set( "outline", outline )
+        if ( output_act ): elem.setAttribute( "action", action )
+        if ( outline == 'all' ) or ( outline == 'none' ): elem.setAttribute( "outline", outline )
         else:
-            elem.set( "outline", "points" )
+            elem.setAttribute( "outline", "points" )
             for pair in string.split( outline, ";" ):
                 p = string.split( pair, "," )
                 point = Element( "point" )
-                point.set( "x", p[ 0 ] )
-                point.set( "y", p[ 1 ] )
-                elem.append( point )
+                point.setAttribute( "x", p[ 0 ] )
+                point.setAttribute( "y", p[ 1 ] )
+                elem.appendChild( point )
         str = elem.toxml()
         elem.unlink()
         return str
@@ -94,10 +93,13 @@
 
     def interpret_dom(self,xml_dom):
         self.use_fog=1
-        children = xml_dom.getchildren()
+        #print 'fog_msg.interpret_dom called'
+        children = xml_dom._get_childNodes()
+        #print "children",children
         for l in children:
-            action = l.get("action")
-            outline = l.get("outline")
+            action = l.getAttribute("action")
+            outline = l.getAttribute("outline")
+            #print "action/outline",action, outline
             if (outline=="all"):
                 polyline=[]
                 self.fogregion.Clear()
@@ -107,9 +109,14 @@
                 self.fogregion.Clear()
             else:
                 polyline=[]
-                list = l.getchildren()
+                list = l._get_childNodes()
                 for node in list:
-                    polyline.append( IPoint().make( int(node.get("x")), int(node.get("y")) ) )
+                    polyline.append( IPoint().make( int(node.getAttribute("x")), int(node.getAttribute("y")) ) )
+                    # pointarray = outline.split(";")
+                    # for m in range(len(pointarray)):
+                    #     pt=pointarray[m].split(",")
+                    #     polyline.append(IPoint().make(int(pt[0]),int(pt[1])))
+                    #print "length of polyline", len(polyline)
             if (len(polyline)>2):
                 if action=="del": self.fogregion.FromPolygon(polyline,0)
                 else: self.fogregion.FromPolygon(polyline,1)
--- a/orpg/mapper/grid.py	Sat Nov 21 03:19:34 2009 -0600
+++ b/orpg/mapper/grid.py	Mon Nov 23 03:22:50 2009 -0600
@@ -33,8 +33,6 @@
 from miniatures import SNAPTO_ALIGN_TL
 from math import floor
 
-from xml.etree.ElementTree import ElementTree, Element, tostring
-
 # Grid mode constants
 GRID_RECTANGLE = 0
 GRID_HEXAGON = 1
@@ -63,7 +61,7 @@
         #size_ratio is the size ajustment for Hex and ISO to make them more accurate
         self.size_ratio = 1.5
         self.snap = True
-        self.color = wx.BLACK # = color.Get()
+        self.color = wx.BLACK# = color.Get()
         #self.color = cmpColour(r,g,b)
         self.r_h = RGBHex()
         self.mode = GRID_RECTANGLE
@@ -389,37 +387,38 @@
             # Disable pen/brush optimizations to prevent any odd effects elsewhere
 
     def layerToXML(self,action = "update"):
-        xml = Element('grid')
+        xml_str = "<grid"
         if self.color != None:
             (red,green,blue) = self.color.Get()
             hexcolor = self.r_h.hexstring(red, green, blue)
-            xml.set('color', hexcolor)
-        if self.unit_size != None: xml.set('size', str(self.unit_size))
-        if self.iso_ratio != None: xml.set('ratio', str(self.iso_ratio))
+            xml_str += " color='" + hexcolor + "'"
+        if self.unit_size != None: xml_str += " size='" + str(self.unit_size) + "'"
+        if self.iso_ratio != None: xml_str += " ratio='" + str(self.iso_ratio) + "'"
         if self.snap != None:
-            if self.snap: xml.set('snap', '1')
-            else: xml.set('snap', '0')
-        if self.mode != None: xml.set('mode', str(self.mode))
-        if self.line != None: xml.set('line', str(self.line))
+            if self.snap: xml_str += " snap='1'"
+            else: xml_str += " snap='0'"
+        if self.mode != None: xml_str+= "  mode='" + str(self.mode) + "'"
+        if self.line != None: xml_str+= " line='" + str(self.line) + "'"
+        xml_str += "/>"
         if (action == "update" and self.isUpdated) or action == "new":
             self.isUpdated = False
-            return tostring(xml)
+            return xml_str
         else: return ''
 
     def layerTakeDOM(self, xml_dom):
-        if xml_dom.get("color"):
-            r,g,b = self.r_h.rgb_tuple(xml_dom.get("color"))
+        if xml_dom.hasAttribute("color"):
+            r,g,b = self.r_h.rgb_tuple(xml_dom.getAttribute("color"))
             self.set_color(cmpColour(r,g,b))
         #backwards compatible with non-isometric map formated clients
         ratio = RATIO_DEFAULT
-        if xml_dom.get("ratio"): ratio = xml_dom.get("ratio")
-        if xml_dom.get("mode"):
-            self.SetMode(int(xml_dom.get("mode")))
-        if xml_dom.get("size"):
-            self.unit_size = int(xml_dom.get("size"))
+        if xml_dom.hasAttribute("ratio"): ratio = xml_dom.getAttribute("ratio")
+        if xml_dom.hasAttribute("mode"):
+            self.SetMode(int(xml_dom.getAttribute("mode")))
+        if xml_dom.hasAttribute("size"):
+            self.unit_size = int(xml_dom.getAttribute("size"))
             self.unit_size_y = self.unit_size
-        if xml_dom.get("snap"):
-            if (xml_dom.get("snap") == 'True') or (xml_dom.get("snap") == "1"): self.snap = True
+        if xml_dom.hasAttribute("snap"):
+            if (xml_dom.getAttribute("snap") == 'True') or (xml_dom.getAttribute("snap") == "1"): self.snap = True
             else: self.snap = False
-        if xml_dom.get("line"):
-            self.SetLine(int(xml_dom.get("line")))
+        if xml_dom.hasAttribute("line"):
+            self.SetLine(int(xml_dom.getAttribute("line")))
--- a/orpg/mapper/grid_msg.py	Sat Nov 21 03:19:34 2009 -0600
+++ b/orpg/mapper/grid_msg.py	Mon Nov 23 03:22:50 2009 -0600
@@ -30,10 +30,8 @@
 from base_msg import map_element_msg_base
 #from base_msg import * ## ?? import all? Deprecated!?
 
-from xml.etree.ElementTree import ElementTree
-
 class grid_msg(map_element_msg_base):
 
     def __init__(self,reentrant_lock_object = None):
         self.tagname = "grid"
-        map_element_msg_base.__init__(self, reentrant_lock_object)
+        map_element_msg_base.__init__(self,reentrant_lock_object)
--- a/orpg/mapper/images.py	Sat Nov 21 03:19:34 2009 -0600
+++ b/orpg/mapper/images.py	Mon Nov 23 03:22:50 2009 -0600
@@ -63,7 +63,7 @@
             if self.__fetching[path]:
                 thread.start_new_thread(self.__loadCacheThread,
                                         (path, image_type, imageId))
-        return wx.Bitmap(dir_struct["icon"] + "fetching.png", wx.BITMAP_TYPE_PNG)
+        return wx.Image(dir_struct["icon"] + "fetching.png", wx.BITMAP_TYPE_PNG)
 
     def directLoad(self, path):
         # Directly load an image, no threads
--- a/orpg/mapper/map.py	Sat Nov 21 03:19:34 2009 -0600
+++ b/orpg/mapper/map.py	Mon Nov 23 03:22:50 2009 -0600
@@ -35,6 +35,7 @@
 import random
 import os
 import thread
+#import gc #Garbage Collecter Needed?
 import traceback
 
 from miniatures_handler import *
@@ -48,7 +49,6 @@
 from images import ImageHandler
 from orpg.orpgCore import component
 from orpg.tools.orpg_settings import settings
-from xml.etree.ElementTree import ElementTree, Element, tostring, parse
 
 # Various marker modes for player tools on the map
 MARKER_MODE_NONE = 0
@@ -62,7 +62,6 @@
         self.session = component.get("session")
         wx.ScrolledWindow.__init__(self, parent, ID, 
             style=wx.HSCROLL | wx.VSCROLL | wx.FULL_REPAINT_ON_RESIZE | wx.SUNKEN_BORDER )
-        self.SetBackgroundStyle(wx.BG_STYLE_CUSTOM)
         self.frame = parent
         self.MAP_MODE = 1      #Mode 1 = MINI, 2 = DRAW, 3 = TAPE MEASURE
         self.layers = {}
@@ -109,14 +108,6 @@
         # miniatures drag
         self.drag = None
 
-        #self.Bind(wx.EVT_MOUSEWHEEL, self.MouseWheel)
-
-    def MouseWheel(self, evt):
-        if evt.CmdDown():
-            if evt.GetWheelRotation() > 0: self.on_zoom_in(None)
-            elif evt.GetWheelRotation() < 0: self.on_zoom_out(None)
-            else: pass
-
     def better_refresh(self, event=None):
         self.Refresh(True)
 
@@ -125,21 +116,43 @@
 
     def processImages(self, evt=None):
         self.session = component.get("session")
-        tabs = ['Background', 'Grid', 'Miniatures', 'Whiteboard', 'Fog', 'General']
         if self.session.my_role() == self.session.ROLE_LURKER or (str(self.session.group_id) == '0' and str(self.session.status) == '1'):
-            for tab in tabs:
-                cidx = self.parent.get_tab_index(tab)
-                self.parent.tabs.EnableTab(cidx, False)
-        elif self.session.my_role() == self.session.ROLE_PLAYER:
-            for tab in tabs:
-                cidx = self.parent.get_tab_index(tab)
-                if tab == "Miniatures" or tab == "Whiteboard": 
-                    self.parent.tabs.EnableTab(cidx, True)
-                else: self.parent.tabs.EnableTab(cidx, False)
-        elif self.session.my_role() == self.session.ROLE_GM and str(self.session.group_id) != '0':
-            for tab in tabs:
-                cidx = self.parent.get_tab_index(tab)
-                self.parent.tabs.EnableTab(cidx, True)
+            cidx = self.parent.get_tab_index("Background")
+            self.parent.layer_tabs.EnableTab(cidx, False)
+            cidx = self.parent.get_tab_index("Grid")
+            self.parent.layer_tabs.EnableTab(cidx, False)
+            cidx = self.parent.get_tab_index("Miniatures")
+            self.parent.layer_tabs.EnableTab(cidx, False)
+            cidx = self.parent.get_tab_index("Whiteboard")
+            self.parent.layer_tabs.EnableTab(cidx, False)
+            cidx = self.parent.get_tab_index("Fog")
+            self.parent.layer_tabs.EnableTab(cidx, False)
+            cidx = self.parent.get_tab_index("General")
+            self.parent.layer_tabs.EnableTab(cidx, False)
+        else:
+            cidx = self.parent.get_tab_index("Background")
+            if not self.parent.layer_tabs.GetEnabled(cidx):
+                cidx = self.parent.get_tab_index("Miniatures")
+                self.parent.layer_tabs.EnableTab(cidx, True)
+                cidx = self.parent.get_tab_index("Whiteboard")
+                self.parent.layer_tabs.EnableTab(cidx, True)
+                cidx = self.parent.get_tab_index("Background")
+                self.parent.layer_tabs.EnableTab(cidx, False)
+                cidx = self.parent.get_tab_index("Grid")
+                self.parent.layer_tabs.EnableTab(cidx, False)
+                cidx = self.parent.get_tab_index("Fog")
+                self.parent.layer_tabs.EnableTab(cidx, False)
+                cidx = self.parent.get_tab_index("General")
+                self.parent.layer_tabs.EnableTab(cidx, False)
+                if self.session.my_role() == self.session.ROLE_GM:
+                    cidx = self.parent.get_tab_index("Background")
+                    self.parent.layer_tabs.EnableTab(cidx, True)
+                    cidx = self.parent.get_tab_index("Grid")
+                    self.parent.layer_tabs.EnableTab(cidx, True)
+                    cidx = self.parent.get_tab_index("Fog")
+                    self.parent.layer_tabs.EnableTab(cidx, True)
+                    cidx = self.parent.get_tab_index("General")
+                    self.parent.layer_tabs.EnableTab(cidx, True)
         if not self.cacheSizeSet:
             self.cacheSizeSet = True
             cacheSize = component.get('settings').get_setting("ImageCacheSize")
@@ -148,15 +161,18 @@
         if not ImageHandler.Queue.empty():
             (path, image_type, imageId) = ImageHandler.Queue.get()
             img = wx.ImageFromMime(path[1], path[2])
-            # Now, apply the image to the proper object
-            if image_type == "miniature":
-                min = self.layers['miniatures'].get_miniature_by_id(imageId)
-                if min: min.set_bmp(img)
-            elif image_type == "background" or image_type == "texture":
-                self.layers['bg'].bg_bmp = img.ConvertToBitmap()
-                if image_type == "background": self.set_size([img.GetWidth(), img.GetHeight()])
+            try:
+                # Now, apply the image to the proper object
+                if image_type == "miniature":
+                    min = self.layers['miniatures'].get_miniature_by_id(imageId)
+                    if min: min.set_bmp(img)
+                elif image_type == "background" or image_type == "texture":
+                    self.layers['bg'].bg_bmp = img.ConvertToBitmap()
+                    if image_type == "background": self.set_size([img.GetWidth(), img.GetHeight()])
+            except: pass
             # Flag that we now need to refresh!
             self.requireRefresh += 1
+
             """ Randomly purge an item from the cache, while this is lamo, it does
                 keep the cache from growing without bounds, which is pretty important!"""
             if len(ImageHandler.Cache) >= self.cacheSize:
@@ -237,9 +253,6 @@
         topleft1 = self.GetViewStart()
         topleft = [topleft1[0]*scrollsize[0], topleft1[1]*scrollsize[1]]
         if (clientsize[0] > 1) and (clientsize[1] > 1):
-            #dc = wx.MemoryDC()
-            #bmp = wx.EmptyBitmap(clientsize[0]+1, clientsize[1]+1)
-            #dc.SelectObject(bmp)
             dc = wx.AutoBufferedPaintDC(self)
             dc.SetPen(wx.TRANSPARENT_PEN)
             dc.SetBrush(wx.Brush(self.GetBackgroundColour(), wx.SOLID))
@@ -255,20 +268,11 @@
             self.layers['fog'].layerDraw(dc, topleft, clientsize)
             dc.SetPen(wx.NullPen)
             dc.SetBrush(wx.NullBrush)
-            #dc.SelectObject(wx.NullBitmap)
-            #del dc
-            #wdc = self.preppaint()
-            #wdc.DrawBitmap(bmp, topleft[0], topleft[1])
             if settings.get_setting("AlwaysShowMapScale") == "1":
                 self.showmapscale(dc)
         try: evt.Skip()
         except: pass
 
-    def preppaint(self):
-        dc = wx.PaintDC(self)
-        self.PrepareDC(dc)
-        return (dc)
-
     def showmapscale(self, dc):
         scalestring = "Scale x" + `self.layers['grid'].mapscale`[:3]
         (textWidth, textHeight) = dc.GetTextExtent(scalestring)
@@ -605,53 +609,68 @@
             else: return ""
 
     def takexml(self, xml):
+        """
+          Added Process Dialog to display during long map parsings
+          as well as a try block with an exception traceback to try
+          and isolate some of the map related problems users have been
+          experiencing --Snowdog 5/15/03
+         
+          Apparently Process Dialog causes problems with linux.. commenting it out. sheez.
+           --Snowdog 5/27/03
+        """
         try:
-            xml_dom = fromstring(xml)
+            #parse the map DOM
+            xml_dom = parseXml(xml)
             if xml_dom == None: return
-            node_list = xml_dom.find("map") if xml_dom.tag != 'map' else xml_dom
-            # set map version to incoming data so layers can convert
-            self.map_version = node_list.get("version")
-            action = node_list.get("action")
-            if action == "new":
-                self.layers = {}
-                try: self.layers['bg'] = layer_back_ground(self)
-                except: pass
-                try: self.layers['grid'] = grid_layer(self)
-                except: pass
-                try: self.layers['miniatures'] = miniature_layer(self)
-                except: pass
-                try: self.layers['whiteboard'] = whiteboard_layer(self)
-                except: pass
-                try: self.layers['fog'] = fog_layer(self)
-                except: pass
-            sizex = node_list.get("sizex") if node_list.get("sizex") != None else ''
-            if sizex != "":
-                sizex = int(float(sizex))
-                sizey = self.size[1]
-                self.set_size((sizex,sizey))
-                self.size_changed = 0
-            sizey = node_list.get("sizey") if node_list.get('sizey') != None else ''
-            if sizey != "":
-                sizey = int(float(sizey))
-                sizex = self.size[0]
-                self.set_size((sizex,sizey))
-                self.size_changed = 0
-            children = node_list.getchildren()
-            #fog layer must be computed first, so that no data is inadvertently revealed
-            for c in children:
-                if c.tag == "fog": self.layers[c.tag].layerTakeDOM(c)
-            for c in children:
-                if c.tag != "fog": self.layers[c.tag].layerTakeDOM(c)
-            # all map data should be converted, set map version to current version
-            self.map_version = MAP_VERSION
-            self.Refresh(False)
-        except Exception, e: print 'failed', e; pass
+            node_list = xml_dom.getElementsByTagName("map")
+            if len(node_list) < 1: pass
+            else:
+                # set map version to incoming data so layers can convert
+                self.map_version = node_list[0].getAttribute("version")
+                action = node_list[0].getAttribute("action")
+                if action == "new":
+                    self.layers = {}
+                    try: self.layers['bg'] = layer_back_ground(self)
+                    except: pass
+                    try: self.layers['grid'] = grid_layer(self)
+                    except: pass
+                    try: self.layers['miniatures'] = miniature_layer(self)
+                    except: pass
+                    try: self.layers['whiteboard'] = whiteboard_layer(self)
+                    except: pass
+                    try: self.layers['fog'] = fog_layer(self)
+                    except: pass
+                sizex = node_list[0].getAttribute("sizex")
+                if sizex != "":
+                    sizex = int(float(sizex))
+                    sizey = self.size[1]
+                    self.set_size((sizex,sizey))
+                    self.size_changed = 0
+                sizey = node_list[0].getAttribute("sizey")
+                if sizey != "":
+                    sizey = int(float(sizey))
+                    sizex = self.size[0]
+                    self.set_size((sizex,sizey))
+                    self.size_changed = 0
+                children = node_list[0]._get_childNodes()
+                #fog layer must be computed first, so that no data is inadvertently revealed
+                for c in children:
+                    name = c._get_nodeName()
+                    if name == "fog": self.layers[name].layerTakeDOM(c)
+                for c in children:
+                    name = c._get_nodeName()
+                    if name != "fog": self.layers[name].layerTakeDOM(c)
+                # all map data should be converted, set map version to current version
+                self.map_version = MAP_VERSION
+                self.Refresh(False)
+            xml_dom.unlink()  # eliminate circular refs
+        except: pass
 
     def re_ids_in_xml(self, xml):
         new_xml = ""
         tmp_map = map_msg()
-        xml_dom = fromstring(str(xml))
-        node_list = xml_dom.findall("map")
+        xml_dom = parseXml(str(xml))
+        node_list = xml_dom.getElementsByTagName("map")
         if len(node_list) < 1: pass
         else:
             tmp_map.init_from_dom(node_list[0])
@@ -674,9 +693,9 @@
                     if lines:
                         for line in lines:
                             l = whiteboard_layer.children[line]
-                            if l.tag == 'line': id = 'line-' + self.frame.session.get_next_id()
-                            elif l.tag == 'text': id = 'text-' + self.frame.session.get_next_id()
-                            elif l.tag == 'circle': id = 'circle-' + self.frame.session.get_next_id()
+                            if l.tagname == 'line': id = 'line-' + self.frame.session.get_next_id()
+                            elif l.tagname == 'text': id = 'text-' + self.frame.session.get_next_id()
+                            elif l.tagname == 'circle': id = 'circle-' + self.frame.session.get_next_id()
                             l.init_prop("id", id)
             new_xml = tmp_map.get_all_xml()
         if xml_dom: xml_dom.unlink()
@@ -691,35 +710,30 @@
         self.top_frame = component.get('frame')
         self.root_dir = os.getcwd()
         self.current_layer = 2
-        self.tabs = orpgTabberWnd(self, style=FNB.FNB_NO_X_BUTTON|FNB.FNB_BOTTOM|FNB.FNB_NO_NAV_BUTTONS)
-        self.handlers = {}
-        self.handlers[0]=(background_handler(self.tabs,-1,self.canvas))
-        self.tabs.AddPage(self.handlers[0],"Background")
-        self.handlers[1]=(grid_handler(self.tabs,-1,self.canvas))
-        self.tabs.AddPage(self.handlers[1],"Grid")
-        self.handlers[2]=(miniatures_handler(self.tabs,-1,self.canvas))
-        self.tabs.AddPage(self.handlers[2],"Miniatures", True)
-        self.handlers[3]=(whiteboard_handler(self.tabs,-1,self.canvas))
-        self.tabs.AddPage(self.handlers[3],"Whiteboard")
-        self.handlers[4]=(fog_handler(self.tabs,-1,self.canvas))
-        self.tabs.AddPage(self.handlers[4],"Fog")
-        self.handlers[5]=(map_handler(self.tabs,-1,self.canvas))
-        self.tabs.AddPage(self.handlers[5],"General")
-        self.tabs.SetSelection(2)
+        self.layer_tabs = orpgTabberWnd(self, style=FNB.FNB_NO_X_BUTTON|FNB.FNB_BOTTOM|FNB.FNB_NO_NAV_BUTTONS)
+        self.layer_handlers = []
+        self.layer_handlers.append(background_handler(self.layer_tabs,-1,self.canvas))
+        self.layer_tabs.AddPage(self.layer_handlers[0],"Background")
+        self.layer_handlers.append(grid_handler(self.layer_tabs,-1,self.canvas))
+        self.layer_tabs.AddPage(self.layer_handlers[1],"Grid")
+        self.layer_handlers.append(miniatures_handler(self.layer_tabs,-1,self.canvas))
+        self.layer_tabs.AddPage(self.layer_handlers[2],"Miniatures", True)
+        self.layer_handlers.append(whiteboard_handler(self.layer_tabs,-1,self.canvas))
+        self.layer_tabs.AddPage(self.layer_handlers[3],"Whiteboard")
+        self.layer_handlers.append(fog_handler(self.layer_tabs,-1,self.canvas))
+        self.layer_tabs.AddPage(self.layer_handlers[4],"Fog")
+        self.layer_handlers.append(map_handler(self.layer_tabs,-1,self.canvas))
+        self.layer_tabs.AddPage(self.layer_handlers[5],"General")
+        self.layer_tabs.SetSelection(2)
         self.sizer = wx.BoxSizer(wx.VERTICAL)
         self.sizer.Add(self.canvas, 1, wx.EXPAND)
-        self.sizer.Add(self.tabs, 0, wx.EXPAND)
+        self.sizer.Add(self.layer_tabs, 0, wx.EXPAND)
         self.SetSizer(self.sizer)
         self.Bind(FNB.EVT_FLATNOTEBOOK_PAGE_CHANGED, self.on_layer_change)
         #self.Bind(wx.EVT_SIZE, self.on_size)
         self.Bind(wx.EVT_LEAVE_WINDOW, self.OnLeave)
         self.load_default()
 
-        ## Components for making Map Based plugins that create new tabs.
-        component.add('map_tabs', self.tabs)
-        component.add('map_layers', self.handlers)
-        component.add('map_wnd', self)
-
     def OnLeave(self, evt):
         if "__WXGTK__" in wx.PlatformInfo: wx.SetCursor(wx.StockCursor(wx.CURSOR_ARROW))
 
@@ -773,41 +787,41 @@
         os.chdir(self.root_dir)
 
     def get_current_layer_handler(self):
-        return self.handlers[self.current_layer]
+        return self.layer_handlers[self.current_layer]
 
     def get_tab_index(self, layer):
         """Return the index of a chatpanel in the wxNotebook."""
-        for i in xrange(self.tabs.GetPageCount()):
-            if (self.tabs.GetPageText(i) == layer):
+        for i in xrange(self.layer_tabs.GetPageCount()):
+            if (self.layer_tabs.GetPageText(i) == layer):
                 return i
         return 0
 
     def on_layer_change(self, evt):
-        layer = self.tabs.GetPage(evt.GetSelection())
-        for i in xrange(0, len(self.handlers)):
-            if layer == self.handlers[i]: self.current_layer = i
+        layer = self.layer_tabs.GetPage(evt.GetSelection())
+        for i in xrange(0, len(self.layer_handlers)):
+            if layer == self.layer_handlers[i]: self.current_layer = i
         if self.current_layer == 0:
-            bg = self.handlers[0]
+            bg = self.layer_handlers[0]
             if (self.session.my_role() != self.session.ROLE_GM): bg.url_path.Show(False)
             else: bg.url_path.Show(True)
         self.canvas.Refresh(False)
         evt.Skip()
 
     def on_left_down(self, evt):
-        self.handlers[self.current_layer].on_left_down(evt)
+        self.layer_handlers[self.current_layer].on_left_down(evt)
 
     #double click handler added by Snowdog 5/03
     def on_left_dclick(self, evt):
-        self.handlers[self.current_layer].on_left_dclick(evt)
+        self.layer_handlers[self.current_layer].on_left_dclick(evt)
 
     def on_right_down(self, evt):
-        self.handlers[self.current_layer].on_right_down(evt)
+        self.layer_handlers[self.current_layer].on_right_down(evt)
 
     def on_left_up(self, evt):
-        self.handlers[self.current_layer].on_left_up(evt)
+        self.layer_handlers[self.current_layer].on_left_up(evt)
 
     def on_motion(self, evt):
-        self.handlers[self.current_layer].on_motion(evt)
+        self.layer_handlers[self.current_layer].on_motion(evt)
 
     def MapBar(self, id, data):
         self.canvas.MAP_MODE = data
@@ -824,8 +838,8 @@
         except: pass
 
     def update_tools(self):
-        for h in self.handlers:
-            self.handlers[h].update_info()
+        for h in self.layer_handlers:
+            h.update_info()
 
     def on_hk_map_layer(self, evt):
         id = self.top_frame.mainmenu.GetHelpString(evt.GetId())
@@ -835,7 +849,7 @@
         elif id == "Whiteboard Layer": self.current_layer = self.get_tab_index("Whiteboard")
         elif id == "Fog Layer": self.current_layer = self.get_tab_index("Fog")
         elif id == "General Properties": self.current_layer = self.get_tab_index("General")
-        self.tabs.SetSelection(self.current_layer)
+        self.layer_tabs.SetSelection(self.current_layer)
 
     def on_flush_cache(self, evt):
         ImageHandler.flushCache()
--- a/orpg/mapper/map_msg.py	Sat Nov 21 03:19:34 2009 -0600
+++ b/orpg/mapper/map_msg.py	Mon Nov 23 03:22:50 2009 -0600
@@ -34,11 +34,6 @@
 from miniatures_msg import *
 from whiteboard_msg import *
 from fog_msg import *
-import traceback
-from orpg.dirpath import dir_struct
-
-from xml.etree.ElementTree import ElementTree, Element, iselement
-from xml.etree.ElementTree import fromstring, tostring, parse
 
 """
 <map name=? id=? >
@@ -51,35 +46,25 @@
 
 """
 
-def Crash(type, value, crash):
-    crash_report = open(dir_struct["home"] + 'crash-report.txt', "w")
-    traceback.print_exception(type, value, crash, file=crash_report)
-    crash_report.close()
-    msg = ''
-    crash_report = open(dir_struct["home"] + 'crash-report.txt', "r")
-    for line in crash_report: msg += line
-    print msg
-    crash_report.close()
-
 class map_msg(map_element_msg_base):
 
     def __init__(self,reentrant_lock_object = None):
         self.tagname = "map"
-        map_element_msg_base.__init__(self, reentrant_lock_object)
+        map_element_msg_base.__init__(self,reentrant_lock_object)
 
-    def init_from_dom(self, xml_dom):
+    def init_from_dom(self,xml_dom):
         self.p_lock.acquire()
-        if xml_dom.tag == self.tagname:
+        if xml_dom.tagName == self.tagname:
             # If this is a map message, look for the "action=new"
             # Notice we only do this when the root is a map tag
-            if self.tagname == "map" and xml_dom.get("action") == "new":
+            if self.tagname == "map" and xml_dom.hasAttribute("action") and xml_dom.getAttribute("action") == "new":
                 self.clear()
             # Process all of the properties in each tag
-            if xml_dom.keys():
-                for k in xml_dom.keys():
-                    self.init_prop(k, xml_dom.get(k))
-            for c in xml_dom.getchildren():
-                name = c.tag
+            if xml_dom.getAttributeKeys():
+                for k in xml_dom.getAttributeKeys():
+                    self.init_prop(k,xml_dom.getAttribute(k))
+            for c in xml_dom._get_childNodes():
+                name = c._get_nodeName()
                 if not self.children.has_key(name):
                     if name == "miniatures": self.children[name] = minis_msg(self.p_lock)
                     elif name == "grid": self.children[name] = grid_msg(self.p_lock)
@@ -100,17 +85,17 @@
 
     def set_from_dom(self,xml_dom):
         self.p_lock.acquire()
-        if xml_dom.tag == self.tagname:
+        if xml_dom.tagName == self.tagname:
             # If this is a map message, look for the "action=new"
             # Notice we only do this when the root is a map tag
-            if self.tagname == "map" and xml_dom.get("action") == "new":
+            if self.tagname == "map" and xml_dom.hasAttribute("action") and xml_dom.getAttribute("action") == "new":
                 self.clear()
             # Process all of the properties in each tag
-            if xml_dom.keys():
-                for k in xml_dom.keys():
-                    self.set_prop(k,xml_dom.get(k))
-            for c in xml_dom.getchildren():
-                name = c.tag
+            if xml_dom.getAttributeKeys():
+                for k in xml_dom.getAttributeKeys():
+                    self.set_prop(k,xml_dom.getAttribute(k))
+            for c in xml_dom._get_childNodes():
+                name = c._get_nodeName()
                 if not self.children.has_key(name):
                     if name == "miniatures": self.children[name] = minis_msg(self.p_lock)
                     elif name == "grid": self.children[name] = grid_msg(self.p_lock)
@@ -134,4 +119,3 @@
 
     def get_changed_xml(self, action="update", output_action=1):
         return map_element_msg_base.get_changed_xml(self, action, output_action)
-crash = sys.excepthook = Crash
--- a/orpg/mapper/miniatures.py	Sat Nov 21 03:19:34 2009 -0600
+++ b/orpg/mapper/miniatures.py	Mon Nov 23 03:22:50 2009 -0600
@@ -319,57 +319,67 @@
             dc.DrawText(label,x+1,y+1)
 
     def toxml(self, action="update"):
-        mini = Element('miniature')
-        if action == 'del':
-            mini.set('action', action)
-            mini.set('id', str(self.id))
-            return tostring(mini)
-        mini.set('action', action)
-        mini.set('id', str(self.id))
-        mini.set('label', self.label)
+        if action == "del":
+            xml_str = "<miniature action='del' id='" + self.id + "'/>"
+            return xml_str
+        xml_str = "<miniature"
+        xml_str += " action='" + action + "'"
+        xml_str += " label='" + self.label + "'"
+        xml_str+= " id='" + self.id + "'"
         if self.pos != None:
-            mini.set('posx', str(self.pos.x))
-            mini.set('posy', str(self.pos.y))
-        if self.heading != None: mini.set('heading', str(self.heading))
-        if self.face != None: mini.set('face', str(self.face))
-        if self.path != None: mini.set('path', str(urllib.quote(self.path).replace('%3A', ':')))
-        mini.set('locked', '1') if self.locked else mini.set('locked', '0')
-        mini.set('hide', '1') if self.hide else mini.set('hide', '0')
-        if self.snap_to_align != None: mini.set('align', str(self.snap_to_align))
-        if self.id != None: mini.set('zorder', str(self.zorder))
-        if self.width != None: mini.set('width', str(self.width))
-        if self.height != None: mini.set('height', str(self.height))
+            xml_str += " posx='" + str(self.pos.x) + "'"
+            xml_str += " posy='" + str(self.pos.y) + "'"
+        if self.heading != None: xml_str += " heading='" + str(self.heading) + "'"
+        if self.face != None: xml_str += " face='" + str(self.face) + "'"
+        if self.path != None: xml_str += " path='" + urllib.quote(self.path).replace('%3A', ':') + "'"
+        if self.locked: xml_str += "  locked='1'"
+        else: xml_str += "  locked='0'"
+        if self.hide: xml_str += " hide='1'"
+        else: xml_str += " hide='0'"
+        if self.snap_to_align != None: xml_str += " align='" + str(self.snap_to_align) + "'"
+        if self.id != None: xml_str += " zorder='" + str(self.zorder) + "'"
+        if self.width != None: xml_str += " width='" + str(self.width) + "'"
+        if self.height != None: xml_str += " height='" + str(self.height) + "'"
         if self.local:
-            mini.set('local', str(self.local))
-            mini.set('localPath', str(urllib.quote(self.localPath).replace('%3A', ':')))
-            mini.set('localTime', str(localTime))
+            xml_str += ' local="' + str(self.local) + '"'
+            xml_str += ' localPath="' + str(urllib.quote(self.localPath).replace('%3A', ':')) + '"'
+            xml_str += ' localTime="' + str(self.localTime) + '"'
+        xml_str += " />"
         if (action == "update" and self.isUpdated) or action == "new":
             self.isUpdated = False
-            return mini
+            print xml_str; return xml_str
         else: return ''
 
     def takedom(self, xml_dom):
-        self.id = xml_dom.get("id")
-        if xml_dom.get("posx"): self.pos.x = int(xml_dom.get("posx"))
-        if xml_dom.get("posy"): self.pos.y = int(xml_dom.get("posy"))
-        if xml_dom.get("heading"): self.heading = int(xml_dom.get("heading"))
-        if xml_dom.get("face"): self.face = int(xml_dom.get("face"))
-        if xml_dom.get("path"):
-            self.path = urllib.unquote(xml_dom.get("path"))
+        self.id = xml_dom.getAttribute("id")
+        if xml_dom.hasAttribute("posx"):
+            self.pos.x = int(xml_dom.getAttribute("posx"))
+        if xml_dom.hasAttribute("posy"):
+            self.pos.y = int(xml_dom.getAttribute("posy"))
+        if xml_dom.hasAttribute("heading"):
+            self.heading = int(xml_dom.getAttribute("heading"))
+        if xml_dom.hasAttribute("face"):
+            self.face = int(xml_dom.getAttribute("face"))
+        if xml_dom.hasAttribute("path"):
+            self.path = urllib.unquote(xml_dom.getAttribute("path"))
             self.set_bmp(ImageHandler.load(self.path, 'miniature', self.id))
-        if xml_dom.get("locked"):
-            if xml_dom.get("locked") == '1' or xml_dom.get("locked") == 'True': self.locked = True
+        if xml_dom.hasAttribute("locked"):
+            if xml_dom.getAttribute("locked") == '1' or xml_dom.getAttribute("locked") == 'True': self.locked = True
             else: self.locked = False
-        if xml_dom.get("hide"):
-            if xml_dom.get("hide") == '1' or xml_dom.get("hide") == 'True': self.hide = True
+        if xml_dom.hasAttribute("hide"):
+            if xml_dom.getAttribute("hide") == '1' or xml_dom.getAttribute("hide") == 'True': self.hide = True
             else: self.hide = False
-        if xml_dom.get("label"): self.label = xml_dom.get("label")
-        if xml_dom.get("zorder"): self.zorder = int(xml_dom.get("zorder"))
-        if xml_dom.get("align"):
-            if xml_dom.get("align") == '1' or xml_dom.get("align") == 'True': self.snap_to_align = 1
+        if xml_dom.hasAttribute("label"):
+            self.label = xml_dom.getAttribute("label")
+        if xml_dom.hasAttribute("zorder"):
+            self.zorder = int(xml_dom.getAttribute("zorder"))
+        if xml_dom.hasAttribute("align"):
+            if xml_dom.getAttribute("align") == '1' or xml_dom.getAttribute("align") == 'True': self.snap_to_align = 1
             else: self.snap_to_align = 0
-        if xml_dom.get("width"): self.width = int(xml_dom.get("width"))
-        if xml_dom.get("height"): self.height = int(xml_dom.get("height"))
+        if xml_dom.hasAttribute("width"):
+            self.width = int(xml_dom.getAttribute("width"))
+        if xml_dom.hasAttribute("height"):
+            self.height = int(xml_dom.getAttribute("height"))
 
 ##-----------------------------
 ## miniature layer
@@ -482,49 +492,51 @@
 
     def layerToXML(self, action="update"):
         """ format  """
-        mini_string = ""
+        minis_string = ""
         if self.miniatures:
-            for m in self.miniatures: mini_string = m.toxml(action)
-        if mini_string != '':
-            s = Element('miniatures')
-            s.set('serial', str(self.serial_number))
-            s.append(mini_string)
-            return tostring(s)
+            for m in self.miniatures: minis_string += m.toxml(action)
+        if minis_string != '':
+            s = "<miniatures"
+            s += " serial='" + str(self.serial_number) + "'"
+            s += ">"
+            s += minis_string
+            s += "</miniatures>"
+            return s
         else: return ""
 
     def layerTakeDOM(self, xml_dom):
-        if xml_dom.get('serial'):
-            self.serial_number = int(xml_dom.get('serial'))
-        children = xml_dom.getchildren()
+        if xml_dom.hasAttribute('serial'):
+            self.serial_number = int(xml_dom.getAttribute('serial'))
+        children = xml_dom._get_childNodes()
         for c in children:
-            action = c.get("action")
-            id = c.get('id')
+            action = c.getAttribute("action")
+            id = c.getAttribute('id')
             if action == "del": 
                 mini = self.get_miniature_by_id(id)
                 if mini:
                     self.miniatures.remove(mini)
                     del mini
             elif action == "new":
-                pos = cmpPoint(int(c.get('posx')),int(c.get('posy')))
-                path = urllib.unquote(c.get('path'))
-                label = c.get('label')
+                pos = cmpPoint(int(c.getAttribute('posx')),int(c.getAttribute('posy')))
+                path = urllib.unquote(c.getAttribute('path'))
+                label = c.getAttribute('label')
                 height = width = heading = face = snap_to_align = zorder = 0
                 locked = hide = False
-                if c.get('height'): height = int(c.get('height')) or 0
-                if c.get('width'): width = int(c.get('width'))
-                if c.get('locked') == 'True' or c.get('locked') == '1': locked = True
-                if c.get('hide') == 'True' or c.get('hide') == '1': hide = True
-                if c.get('heading'): heading = int(c.get('heading'))
-                if c.get('face'): face = int(c.get('face'))
-                if c.get('align'): snap_to_align = int(c.get('align'))
-                if c.get('zorder'): zorder = int(c.get('zorder'))
-                image = ImageHandler.load(path, 'miniature', id)
-                mini = BmpMiniature(id, path, image, pos, heading, face, label, locked, hide, snap_to_align, zorder, width, height, func='minis')
-                self.miniatures.append(mini)
-                if c.get('local') and c.get('local') == 'True' and os.path.exists(urllib.unquote(c.get('localPath'))):
-                    localPath = urllib.unquote(c.get('localPath'))
+                if c.hasAttribute('height'): height = int(c.getAttribute('height'))
+                if c.hasAttribute('width'): width = int(c.getAttribute('width'))
+                if c.getAttribute('locked') == 'True' or c.getAttribute('locked') == '1': locked = True
+                if c.getAttribute('hide') == 'True' or c.getAttribute('hide') == '1': hide = True
+                if c.getAttribute('heading'): heading = int(c.getAttribute('heading'))
+                if c.hasAttribute('face'): face = int(c.getAttribute('face'))
+                if c.hasAttribute('align'): snap_to_align = int(c.getAttribute('align'))
+                if c.getAttribute('zorder'): zorder = int(c.getAttribute('zorder'))
+                min = BmpMiniature(id, path, ImageHandler.load(path, 'miniature', id), pos, heading, 
+                    face, label, locked, hide, snap_to_align, zorder, width, height)
+                self.miniatures.append(min)
+                if c.hasAttribute('local') and c.getAttribute('local') == 'True' and os.path.exists(urllib.unquote(c.getAttribute('localPath'))):
+                    localPath = urllib.unquote(c.getAttribute('localPath'))
                     local = True
-                    localTime = float(c.get('localTime'))
+                    localTime = float(c.getAttribute('localTime'))
                     if localTime-time.time() <= 144000:
                         file = open(localPath, "rb")
                         imgdata = file.read()
@@ -534,7 +546,7 @@
                         postdata = urllib.urlencode({'filename':filename[1], 'imgdata':imgdata, 'imgtype':imgtype})
                         thread.start_new_thread(self.upload, (postdata, localPath, True))
                 #  collapse the zorder.  If the client behaved well, then nothing should change.
-                #  Otherwise, this will ensure that there's some kind of z-order
+                #    Otherwise, this will ensure that there's some kind of z-order
                 self.collapse_zorder()
             else:
                 mini = self.get_miniature_by_id(id)
--- a/orpg/mapper/miniatures_msg.py	Sat Nov 21 03:19:34 2009 -0600
+++ b/orpg/mapper/miniatures_msg.py	Mon Nov 23 03:22:50 2009 -0600
@@ -79,12 +79,12 @@
 
     def init_from_dom(self,xml_dom):
         self.p_lock.acquire()
-        if xml_dom.tag == self.tagname:
-            if xml_dom.keys():
-                for k in xml_dom.keys():
-                    self.init_prop(k, xml_dom.get(k))
+        if xml_dom.tagName == self.tagname:
+            if xml_dom.getAttributeKeys():
+                for k in xml_dom.getAttributeKeys():
+                    self.init_prop(k,xml_dom.getAttribute(k))
 
-            for c in xml_dom.getchildren():
+            for c in xml_dom._get_childNodes():
                 mini = mini_msg(self.p_lock)
                 try: mini.init_from_dom(c)
                 except Exception, e: print e; continue
@@ -107,12 +107,12 @@
 
     def set_from_dom(self,xml_dom):
         self.p_lock.acquire()
-        if xml_dom.tag == self.tagname:
-            if xml_dom.keys():
-                for k in xml_dom.keys():
-                    self.set_prop(k,xml_dom.get(k))
+        if xml_dom.tagName == self.tagname:
+            if xml_dom.getAttributeKeys():
+                for k in xml_dom.getAttributeKeys():
+                    self.set_prop(k,xml_dom.getAttribute(k))
 
-            for c in xml_dom.getchildren():
+            for c in xml_dom._get_childNodes():
                 mini = mini_msg(self.p_lock)
 
                 try: mini.set_from_dom(c)
--- a/orpg/mapper/whiteboard.py	Sat Nov 21 03:19:34 2009 -0600
+++ b/orpg/mapper/whiteboard.py	Mon Nov 23 03:22:50 2009 -0600
@@ -30,10 +30,6 @@
 
 from base import *
 from orpg.mapper.map_utils import *
-from orpg.tools.orpg_log import debug
-from xml.etree.ElementTree import ElementTree, Element, tostring
-
-## I added tr_ to the line and text ID. This should help prevent Traipse's lines from being randomly deleted. ##
 
 def cmp_zorder(first,second):
     f = first.zorder
@@ -103,38 +99,43 @@
         dc.SetTextForeground(wx.Colour(0,0,0))
 
     def toxml(self, action="update"):
-        xml = Element('text')
-        xml.set('action', action)
-        xml.set('id', str(self.id))
-        if action == 'del': return tostring(xml)
-        if self.pointsize != None: xml.set('pointsize', str(self.pointsize))
-        if self.style != None: xml.set('style', str(self.style))
-        if self.weight != None: xml.set('weight', str(self.weight))
-        if self.posx != None: xml.set('posx', str(self.posx))
-        if not (self.posy is None): xml.set('posy', str(self.posy))
-        if self.text_string != None: xml.set('text_string', self.text_string)
-        if self.textcolor != None: xml.set('color', self.textcolor)
+        if action == "del":
+            xml_str = "<text action='del' id='" + str(self.id) + "'/>"
+            return xml_str
+        xml_str = "<text"
+        xml_str += " action='" + action + "'"
+        xml_str += " id='" + str(self.id) + "'"
+        if self.pointsize != None: xml_str += " pointsize='" + str(self.pointsize) + "'"
+        if self.style != None: xml_str += " style='" + str(self.style) + "'"
+        if self.weight != None: xml_str += " weight='" + str(self.weight) + "'"
+        if self.posx != None: xml_str+= " posx='" + str(self.posx) + "'"
+        if not (self.posy is None): xml_str += " posy='" + str(self.posy) + "'"
+        if self.text_string != None: xml_str+= " text_string='" + self.text_string + "'"
+        if self.textcolor != None: xml_str += " color='" + self.textcolor + "'"
+        xml_str += "/>"
         if (action == "update" and self.isUpdated) or action == "new":
             self.isUpdated = False
-            return tostring(xml)
+            return xml_str
         else: return ''
 
     def takedom(self, xml_dom):
-        self.text_string = xml_dom.get("text_string")
-        self.id = xml_dom.get("id")
-        if xml_dom.get("posy"): self.posy = int(xml_dom.get("posy"))
-        if xml_dom.get("posx"): self.posx = int(xml_dom.get("posx"))
-        if xml_dom.get("weight"):
-            self.weight = int(xml_dom.get("weight"))
+        self.text_string = xml_dom.getAttribute("text_string")
+        self.id = xml_dom.getAttribute("id")
+        if xml_dom.hasAttribute("posy"):
+            self.posy = int(xml_dom.getAttribute("posy"))
+        if xml_dom.hasAttribute("posx"):
+            self.posx = int(xml_dom.getAttribute("posx"))
+        if xml_dom.hasAttribute("weight"):
+            self.weight = int(xml_dom.getAttribute("weight"))
             self.font.SetWeight(self.weight)
-        if xml_dom.get("style"):
-            self.style = int(xml_dom.get("style"))
+        if xml_dom.hasAttribute("style"):
+            self.style = int(xml_dom.getAttribute("style"))
             self.font.SetStyle(self.style)
-        if xml_dom.get("pointsize"):
-            self.pointsize = int(xml_dom.get("pointsize"))
+        if xml_dom.hasAttribute("pointsize"):
+            self.pointsize = int(xml_dom.getAttribute("pointsize"))
             self.font.SetPointSize(self.pointsize)
-        if xml_dom.get("color") and xml_dom.get("color") != '':
-            self.textcolor = xml_dom.get("color")
+        if xml_dom.hasAttribute("color") and xml_dom.getAttribute("color") != '':
+            self.textcolor = xml_dom.getAttribute("color")
             if self.textcolor == '#0000000': self.textcolor = '#000000'
 
 class WhiteboardLine:
@@ -211,42 +212,45 @@
         #selected outline
 
     def toxml(self, action="update"):
-        xml = Element('line')
-        xml.set('action', action)
-        xml.set('id', str(self.id))
-        if action == "del": return tostring(xml)
+        if action == "del":
+            xml_str = "<line action='del' id='" + str(self.id) + "'/>"
+            return xml_str
         #  if there are any changes, make sure id is one of them
-        xml.set('line_string', self.line_string)
+        xml_str = "<line"
+        xml_str += " action='" + action + "'"
+        xml_str += " id='" + str(self.id) + "'"
+        xml_str+= " line_string='" + self.line_string + "'"
         if self.upperleft != None:
-            xml.set('upperleftx', str(self.upperleft.x))
-            xml.set('upperlefty', str(self.upperleft.y))
+            xml_str += " upperleftx='" + str(self.upperleft.x) + "'"
+            xml_str += " upperlefty='" + str(self.upperleft.y) + "'"
         if self.lowerright != None:
-            xml.set('lowerrightx', str(self.lowerright.x))
-            xml.set('lowerrighty', str(self.lowerright.y))
+            xml_str+= " lowerrightx='" + str(self.lowerright.x) + "'"
+            xml_str+= " lowerrighty='" + str(self.lowerright.y) + "'"
         if self.linecolor != None:
-            xml.set('color', str(self.linecolor))
+            xml_str += " color='" + str(self.linecolor) + "'"
         if self.linewidth != None:
-            xml.set('width', str(self.linewidth))
-        if action == "new": return tostring(xml)
+            xml_str += " width='" + str(self.linewidth) + "'"
+        xml_str += "/>"
+        if action == "new": return xml_str
         return ''
 
     def takedom(self, xml_dom):
-        self.line_string = xml_dom.get("line_string")
-        self.id = xml_dom.get("id")
-        if xml_dom.get("upperleftx"):
-            self.upperleft.x = int(xml_dom.get("upperleftx"))
-        if xml_dom.get("upperlefty"):
-            self.upperleft.y = int(xml_dom.get("upperlefty"))
-        if xml_dom.get("lowerrightx"):
-            self.lowerright.x = int(xml_dom.get("lowerrightx"))
-        if xml_dom.get("lowerrighty"):
-            self.lowerright.y = int(xml_dom.get("lowerrighty"))
-        if xml_dom.get("color") and xml_dom.get("color") != '':
-            self.linecolor = xml_dom.get("color")
+        self.line_string = xml_dom.getAttribute("line_string")
+        self.id = xml_dom.getAttribute("id")
+        if xml_dom.hasAttribute("upperleftx"):
+            self.upperleft.x = int(xml_dom.getAttribute("upperleftx"))
+        if xml_dom.hasAttribute("upperlefty"):
+            self.upperleft.y = int(xml_dom.getAttribute("upperlefty"))
+        if xml_dom.hasAttribute("lowerrightx"):
+            self.lowerright.x = int(xml_dom.getAttribute("lowerrightx"))
+        if xml_dom.hasAttribute("lowerrighty"):
+            self.lowerright.y = int(xml_dom.getAttribute("lowerrighty"))
+        if xml_dom.hasAttribute("color") and xml_dom.getAttribute("color") != '':
+            self.linecolor = xml_dom.getAttribute("color")
             if self.linecolor == '#0000000':
                 self.linecolor = '#000000'
-        if xml_dom.get("width"):
-            self.linewidth = int(xml_dom.get("width"))
+        if xml_dom.hasAttribute("width"):
+            self.linewidth = int(xml_dom.getAttribute("width"))
 
 ##-----------------------------
 ## whiteboard layer
@@ -283,7 +287,7 @@
         self.serial_number -= 1
 
     def add_line(self, line_string="", upperleft=cmpPoint(0,0), lowerright=cmpPoint(0,0), color="#000000", width=1):
-        id = 'tr_line-' + str(self.next_serial())
+        id = 'line ' + str(self.next_serial())
         line = WhiteboardLine(id, line_string, upperleft, lowerright, color=self.color, width=self.width)
         self.lines.append(line)
         xml_str = "<map><whiteboard>"
@@ -325,6 +329,7 @@
     def del_all_lines(self):
         for i in xrange(len(self.lines)):
             self.del_line(self.lines[0])
+        print self.lines
 
     def del_text(self, text):
         xml_str = "<map><whiteboard>"
@@ -382,7 +387,7 @@
         self.font = font
 
     def add_text(self, text_string, pos, style, pointsize, weight, color="#000000"):
-        id = 'tr_text-' + str(self.next_serial())
+        id = 'text ' + str(self.next_serial())
         text = WhiteboardText(id,text_string, pos, style, pointsize, weight, color)
         self.texts.append(text)
         xml_str = "<map><whiteboard>"
@@ -432,13 +437,13 @@
             return ""
 
     def layerTakeDOM(self, xml_dom):
-        serial_number = xml_dom.get('serial')
+        serial_number = xml_dom.getAttribute('serial')
         if serial_number != "": self.serial_number = int(serial_number)
-        children = xml_dom.getchildren()
+        children = xml_dom._get_childNodes()
         for l in children:
-            nodename = l.tag
-            action = l.get("action")
-            id = l.get('id')
+            nodename = l._get_nodeName()
+            action = l.getAttribute("action")
+            id = l.getAttribute('id')
             if self.serial_number < int(id[5:]): self.serial_number = int(id[5:])
             if action == "del":
                 if nodename == 'line':
@@ -450,17 +455,17 @@
             elif action == "new":
                 if nodename == "line":
                     try:
-                        line_string = l.get('line_string')
-                        upperleftx = l.get('upperleftx')
-                        upperlefty = l.get('upperlefty')
-                        lowerrightx = l.get('lowerrightx')
-                        lowerrighty = l.get('lowerrighty')
+                        line_string = l.getAttribute('line_string')
+                        upperleftx = l.getAttribute('upperleftx')
+                        upperlefty = l.getAttribute('upperlefty')
+                        lowerrightx = l.getAttribute('lowerrightx')
+                        lowerrighty = l.getAttribute('lowerrighty')
                         upperleft = wx.Point(int(upperleftx),int(upperlefty))
                         lowerright = wx.Point(int(lowerrightx),int(lowerrighty))
-                        color = l.get('color')
+                        color = l.getAttribute('color')
                         if color == '#0000000': color = '#000000'
-                        id = l.get('id')
-                        width = int(l.get('width'))
+                        id = l.getAttribute('id')
+                        width = int(l.getAttribute('width'))
                     except:
                         line_string = upperleftx = upperlefty = lowerrightx = lowerrighty = color = 0
                         continue
@@ -468,15 +473,15 @@
                     self.lines.append(line)
                 elif nodename == "text":
                     try:
-                        text_string = l.get('text_string')
-                        style = l.get('style')
-                        pointsize = l.get('pointsize')
-                        weight = l.get('weight')
-                        color = l.get('color')
+                        text_string = l.getAttribute('text_string')
+                        style = l.getAttribute('style')
+                        pointsize = l.getAttribute('pointsize')
+                        weight = l.getAttribute('weight')
+                        color = l.getAttribute('color')
                         if color == '#0000000': color = '#000000'
-                        id = l.get('id')
-                        posx = l.get('posx')
-                        posy = l.get('posy')
+                        id = l.getAttribute('id')
+                        posx = l.getAttribute('posx')
+                        posy = l.getAttribute('posy')
                         pos = wx.Point(0,0)
                         pos.x = int(posx)
                         pos.y = int(posy)
--- a/orpg/mapper/whiteboard_handler.py	Sat Nov 21 03:19:34 2009 -0600
+++ b/orpg/mapper/whiteboard_handler.py	Mon Nov 23 03:22:50 2009 -0600
@@ -30,8 +30,6 @@
 from base_handler import *
 from math import floor
 from math import sqrt
-from orpg.tools.orpg_log import debug
-from xml.etree.ElementTree import ElementTree, Element, tostring
 
 class whiteboard_handler(base_layer_handler):
     def __init__(self, parent, id, canvas):
--- a/orpg/mapper/whiteboard_msg.py	Sat Nov 21 03:19:34 2009 -0600
+++ b/orpg/mapper/whiteboard_msg.py	Mon Nov 23 03:22:50 2009 -0600
@@ -29,7 +29,6 @@
 __version__ = "$Id: whiteboard_msg.py,v 1.12 2007/03/09 14:11:56 digitalxero Exp $"
 
 from base_msg import *
-from xml.etree.ElementTree import ElementTree, Element, tostring
 
 class item_msg(map_element_msg_base):
 
@@ -81,12 +80,12 @@
 
     def init_from_dom(self,xml_dom):
         self.p_lock.acquire()
-        if xml_dom.tag == self.tagname:
-            if xml_dom.keys():
-                for k in xml_dom.keys():
-                    self.init_prop(k,xml_dom.get(k))
-            for c in xml_dom.getchildren():
-                item = item_msg(self.p_lock, c.tag)
+        if xml_dom.tagName == self.tagname:
+            if xml_dom.getAttributeKeys():
+                for k in xml_dom.getAttributeKeys():
+                    self.init_prop(k,xml_dom.getAttribute(k))
+            for c in xml_dom._get_childNodes():
+                item = item_msg(self.p_lock,c._get_nodeName())
                 try: item.init_from_dom(c)
                 except Exception, e:
                     print e
@@ -107,12 +106,12 @@
 
     def set_from_dom(self,xml_dom):
         self.p_lock.acquire()
-        if xml_dom.tag == self.tagname:
-            if xml_dom.keys():
-                for k in xml_dom.keys():
-                    self.set_prop(k, xml_dom.get(k))
-            for c in xml_dom.getchildren():
-                item = item_msg(self.p_lock, c.tag)
+        if xml_dom.tagName == self.tagname:
+            if xml_dom.getAttributeKeys():
+                for k in xml_dom.getAttributeKeys():
+                    self.set_prop(k,xml_dom.getAttribute(k))
+            for c in xml_dom._get_childNodes():
+                item = item_msg(self.p_lock, c._get_nodeName())
                 try: item.set_from_dom(c)
                 except Exception, e:
                     print e
--- a/orpg/networking/gsclient.py	Sat Nov 21 03:19:34 2009 -0600
+++ b/orpg/networking/gsclient.py	Mon Nov 23 03:22:50 2009 -0600
@@ -258,6 +258,7 @@
                 address = server.get('address')
                 self.cur_server_index = 999
                 self.name = server.get('name')
+                self.texts["address"].SetValue(address)
                 if self.session.is_connected():
                     if self.session.host_server == address : return
                     else: self.frame.kill_mplay_session()
--- a/orpg/networking/mplay_server.py	Sat Nov 21 03:19:34 2009 -0600
+++ b/orpg/networking/mplay_server.py	Mon Nov 23 03:22:50 2009 -0600
@@ -92,15 +92,10 @@
         self.persistant = persist
         self.mapFile = None
         ### Needs to use Element Tree closer
-        if mapFile != None:
-            f = open( mapFile )
-            tree = f.read()
-            f.close()
-        else:
-            f = open(orpg.dirpath.dir_struct["template"] + "default_map.xml")
-            tree = f.read()
-            f.close()
-        self.game_map.init_from_xml(fromstring(tree))
+        if mapFile != None: tree = parse(mapFile)
+        else: tree = parse(dir_struct["template"] + "default_map.xml")
+        tree = tree.getroot()
+        self.game_map.init_from_xml(tostring(tree))
 
     def save_map(self):
         if self.mapFile is not None and self.persistant == 1 and self.mapFile.find("default_map.xml") == -1:
@@ -191,7 +186,7 @@
             #el.set('to', player)
             #el.set('from', '0')
             #el.set('group_id', group)
-            #el.text(msg)
+            #el.append(msg)
             self.outbox.put("<msg to='" + player + "' from='0' group_id='" + group + "' />" + msg)
 
     def change_group(self, group_id, groups):
@@ -319,7 +314,6 @@
         # try to use it.
         try:
             self.banDom = parse(self.userPath + 'ban_list.xml')
-            #self.banDom.normalize()
             self.banDoc = self.banDom.getroot()
 
             for element in self.banDom.findall('banned'):
@@ -362,7 +356,6 @@
         # try to use it.
         try:
             self.configDom = parse(self.userPath + 'server_ini.xml')
-            #self.configDom.normalize()
             self.configDoc = self.configDom.getroot()
             if hasattr(self, 'bootPassword'): self.boot_pwd = self.bootPassword
             else:
@@ -476,8 +469,6 @@
             #pull information from config file DOM
             try:
                 roomdefaults = self.configDom.findall("room_defaults")[0]
-                #rd.normalize()
-                #roomdefaults = self.rd.documentElement
                 try:
                     setting = roomdefaults.findall('passwords')[0]
                     rpw = setting.get('allow')
@@ -488,10 +479,10 @@
                 except: self.log_msg("Room Defaults: [Warning] Allowing Passworded Rooms")
                 try:
                     setting = roomdefaults.findall('map')[0]
-                    map = setting.get('file')
-                    if map != "":
-                        roomdefault_map = self.userPath + map.replace("myfiles/", "")
-                        self.log_msg("Room Defaults: Using " + str(map) + " for room map")
+                    mapper = setting.get('file')
+                    if mapper != "":
+                        roomdefault_map = self.userPath + mapper.replace("myfiles/", "")
+                        self.log_msg("Room Defaults: Using " + str(mapper) + " for room map")
                 except: self.log_msg("Room Defaults: [Warning] Using Default Map")
 
                 try:
@@ -758,13 +749,11 @@
             data = ServerPlugins.preParseOutgoing()
             for msg in data:
                 try:
-                    #xml_dom = parseXml(msg)
                     xml_dom = fromstring(msg).getroot()
                     if xml_dom.get('from') and int(xml_dom.get('from')) > -1:
                         xml_dom.set('from', '-1')
                     xml_dom.set('to', 'all')
                     self.incoming_msg_handler(xml_dom, msg)
-                    #xml_dom.unlink()
                 except: pass
             self.p_lock.release()
             time.sleep(0.250)
@@ -1113,15 +1102,9 @@
         new_stub.EnableMessageLogging = self.log_network_messages
         self.sendMsg(newsock, new_stub.toxml("new"), False, None)
 
-        #  try to remove circular refs
-        #if xml_dom:
-        #    xml_dom.unlink()
-
         # send confirmation
         data = self.recvMsg(newsock, new_stub.useCompression, new_stub.compressionType)
-        try:
-            xml_dom = XML(data)
-            #xml_dom = xml_dom._get_documentElement()
+        try: xml_dom = XML(data)
         except Exception, e:
             print e
             (remote_host,remote_port) = newsock.getpeername()
@@ -1129,7 +1112,8 @@
             bad_xml_string += "Please report this bug to the development team at:<br /> "
             bad_xml_string += "<a href=\"http://sourceforge.net/tracker/?group_id=2237&atid=102237\">OpenRPG bugs "
             bad_xml_string += "(http://sourceforge.net/tracker/?group_id=2237&atid=102237)</a><br />"
-            self.sendMsg( newsock, "<msg to='" + props['id'] + "' from='" + props['id'] + "' group_id='0' />" + bad_xml_string, new_stub.useCompression, new_stub.compressionType)
+            self.sendMsg( newsock, "<msg to='" + props['id'] + "' from='" + props['id'] + "' group_id='0' />" + bad_xml_string, 
+                            new_stub.useCompression, new_stub.compressionType)
 
             time.sleep(2)
             newsock.close()
@@ -1165,7 +1149,6 @@
             time.sleep(1)
             self.log_msg("Connection terminating due to version incompatibility with client (ver: " + props['version'] + "  protocol: " + props['protocol_version'] + ")" )
             newsock.close()
-            #if xml_dom: xml_dom.unlink()
             return None
 
         ip = props['ip']
@@ -1178,7 +1161,6 @@
             #  Give messages time to flow
             time.sleep(1)
             newsock.close()
-            #if xml_dom: xml_dom.unlink()
             return None
 
         """
@@ -1235,7 +1217,6 @@
 
         #  Display the lobby message
         self.SendLobbyMessage(newsock,props['id'])
-        #if xml_dom: xml_dom.unlink()
 
     def checkClientVersion(self, clientversion):
         minv = self.minClientVersion.split('.')
@@ -1353,7 +1334,6 @@
         #  Parse the XML received from the connecting client"""
         try:
             xml_dom = XML(data)
-            #xml_dom = xml_dom._get_documentElement()
 
         except:
             try: newsock.close()
@@ -1380,14 +1360,6 @@
             traceback.print_exc()
             return #returning causes connection thread instance to terminate
 
-        #  Again attempt to clean out DOM stuff
-        """
-        try: if xml_dom: xml_dom.unlink()
-        except:
-            print "The following exception caught unlinking xml_dom:"
-            traceback.print_exc()
-            return #returning causes connection thread instance to terminate"""
-
     """
     #========================================================
     #
@@ -1420,20 +1392,15 @@
                 data = None
             except Exception, e:
                 self.log_msg(str(e))
-                #if xml_dom: xml_dom.unlink()
-        #if xml_dom: xml_dom.unlink()
         self.log_msg("message handler thread exiting...")
         self.incoming_event.set()
 
     def parse_incoming_dom(self, data):
-        #debug((data, tostring(data) if iselement(data) else 'None element'))  Sometimes I catch an error.
         end = data.find(">") #locate end of first element of message
         head = data[:end+1]
-        #self.log_msg(head)
         xml_dom = None
         try:
             xml_dom = XML(head)
-            #xml_dom = xml_dom._get_documentElement()
             self.message_action(xml_dom, data)
 
         except Exception, e:
@@ -1488,7 +1455,6 @@
         if act == "set":
             role = xml_dom.get("role")
             boot_pwd = xml_dom.get("boot_pwd")
-        #xml_dom.unlink()
         if group_id != "0":
             self.handle_role(act, player, role, boot_pwd, group_id)
             self.log_msg(("role", (player, role)))
@@ -1505,7 +1471,6 @@
             msg ="<msg to='" + player + "' from='" + player + "' group_id='" + group_id + "'>"
             msg += "<font color='#FF0000'>PONG!?!</font>"
         self.players[player].outbox.put(msg)
-        #xml_dom.unlink()
 
     def do_system(self, xml_dom, data):
         pass
@@ -1825,7 +1790,6 @@
     def incoming_player_handler(self, xml_dom, data):
         id = xml_dom.get("id")
         act = xml_dom.get("action")
-        #group_id = xml_dom.get("group_id")
         group_id = self.players[id].group_id
         ip = self.players[id].ip
         self.log_msg("Player with IP: " + str(ip) + " joined.")
@@ -1981,7 +1945,6 @@
             given_boot_pwd = None
             try:
                 xml_dom = XML(msg)
-                #xml_dom = xml_dom._get_documentElement()
                 given_boot_pwd = xml_dom.get("boot_pwd")
 
             except:
@@ -2092,7 +2055,7 @@
 
     def admin_banip(self, ip, name="", silent = 0):
         "Ban a player from a server from the console"
-        self.adming_buile_banlist() ### Alpha ###
+        self.admin_build_banlist() ### Alpha ###
         try:
             self.ban_list[ip] = {}
             self.ban_list[ip]['ip'] = ip
@@ -2412,8 +2375,7 @@
                         self.players[pid].outbox.put(msg)
                     except: pass
             elif cmd == "savemaps":
-                for g in self.groups.itervalues():
-                    g.save_map()
+                for g in self.groups.itervalues(): g.save_map()
                 msg ="<msg to='" + pid + "' from='0' group_id='" + gid + "'>Persistent room maps saved"
                 self.players[pid].outbox.put(msg)
             else:
--- a/orpg/networking/mplay_server_gui.py	Sat Nov 21 03:19:34 2009 -0600
+++ b/orpg/networking/mplay_server_gui.py	Mon Nov 23 03:22:50 2009 -0600
@@ -568,7 +568,7 @@
     def OnCreateGroup( self, data ):
         (room, room_id, player, pwd) = data
         self.groups.AddGroup(data)
-        self.conns.roomList[room_id] = name
+        self.conns.roomList[room_id] = room
         data = (room, room_id, player)
         self.conns.updateRoom(data)
 
--- a/orpg/orpg_version.py	Sat Nov 21 03:19:34 2009 -0600
+++ b/orpg/orpg_version.py	Mon Nov 23 03:22:50 2009 -0600
@@ -4,7 +4,7 @@
 #BUILD NUMBER FORMAT: "YYMMDD-##" where ## is the incremental daily build index (if needed)
 DISTRO = "Traipse Alpha"
 DIS_VER = "Ornery Orc"
-BUILD = "091021-00"
+BUILD = "091123-00"
 
 # This version is for network capability.
 PROTOCOL_VERSION = "1.2"
--- a/orpg/plugindb.py	Sat Nov 21 03:19:34 2009 -0600
+++ b/orpg/plugindb.py	Mon Nov 23 03:22:50 2009 -0600
@@ -55,7 +55,7 @@
 
     def FetchList(self, parent):
         retlist = []
-        for litem in parent.findall('lobject'):
+        for litem in parent.find('list').findall('lobject'):
             if litem.get('type') == 'int': retlist.append(int(litem.text))
             if litem.get('type') == 'bool': retlist.append(litem.text == 'True')
             elif litem.get('type') == 'float': retlist.append(float(litem.text))
@@ -67,7 +67,6 @@
     def GetList(self, plugname, listname, defaultval=list(), verbose=False):
         listname = self.safe(listname)
         plugin = self.etree.find(plugname)
-
         if plugin is None or plugin.find(listname) is None:
             msg = ["plugindb: no value has been stored for", listname, "in",
                    plugname, "so the default has been returned"]
--- a/upmana/manifest.py	Sat Nov 21 03:19:34 2009 -0600
+++ b/upmana/manifest.py	Mon Nov 23 03:22:50 2009 -0600
@@ -65,7 +65,7 @@
 
     def FetchList(self, parent):
         retlist = []
-        for litem in parent.findall('lobject'):
+        for litem in parent.find('list').findall('lobject'):
             if litem.get('type') == 'int': retlist.append(int(litem.text))
             if litem.get('type') == 'bool': retlist.append(litem.text == 'True')
             elif litem.get('type') == 'float': retlist.append(float(litem.text))