diff orpg/mapper/fog_msg.py @ 122:36919b8a3ef9 alpha

Traipse Alpha 'OpenRPG' {091031-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 Mercurial's hgweb folder is ported to upmana Happy Halloween!
author sirebral
date Sat, 31 Oct 2009 22:07:55 -0500
parents 449a8900f9ac
children 54446a995007 e842a5f1b775
line wrap: on
line diff
--- a/orpg/mapper/fog_msg.py	Fri Oct 30 22:21:40 2009 -0500
+++ b/orpg/mapper/fog_msg.py	Sat Oct 31 22:07:55 2009 -0500
@@ -27,13 +27,14 @@
 
 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.tagname = "fog"
+        self.tag = "fog"
         map_element_msg_base.__init__(self,reentrant_lock_object)
         self.use_fog = 0
         self.fogregion=IRegion()
@@ -41,16 +42,16 @@
 
     def get_line(self,outline,action,output_act):
         elem = Element( "poly" )
-        if ( output_act ): elem.setAttribute( "action", action )
-        if ( outline == 'all' ) or ( outline == 'none' ): elem.setAttribute( "outline", outline )
+        if ( output_act ): elem.set( "action", action )
+        if ( outline == 'all' ) or ( outline == 'none' ): elem.set( "outline", outline )
         else:
-            elem.setAttribute( "outline", "points" )
+            elem.set( "outline", "points" )
             for pair in string.split( outline, ";" ):
                 p = string.split( pair, "," )
                 point = Element( "point" )
-                point.setAttribute( "x", p[ 0 ] )
-                point.setAttribute( "y", p[ 1 ] )
-                elem.appendChild( point )
+                point.set( "x", p[ 0 ] )
+                point.set( "y", p[ 1 ] )
+                elem.append( point )
         str = elem.toxml()
         elem.unlink()
         return str
@@ -94,11 +95,11 @@
     def interpret_dom(self,xml_dom):
         self.use_fog=1
         #print 'fog_msg.interpret_dom called'
-        children = xml_dom._get_childNodes()
+        children = xml_dom.getchildren()
         #print "children",children
         for l in children:
-            action = l.getAttribute("action")
-            outline = l.getAttribute("outline")
+            action = l.get("action")
+            outline = l.get("outline")
             #print "action/outline",action, outline
             if (outline=="all"):
                 polyline=[]
@@ -109,9 +110,9 @@
                 self.fogregion.Clear()
             else:
                 polyline=[]
-                list = l._get_childNodes()
+                list = l.getchildren()
                 for node in list:
-                    polyline.append( IPoint().make( int(node.getAttribute("x")), int(node.getAttribute("y")) ) )
+                    polyline.append( IPoint().make( int(node.get("x")), int(node.get("y")) ) )
                     # pointarray = outline.split(";")
                     # for m in range(len(pointarray)):
                     #     pt=pointarray[m].split(",")