diff orpg/tools/InterParse.py @ 238:b44dad398833 beta

Traipse Beta 'OpenRPG' {100619-00} Traipse is a distribution of OpenRPG that is designed to be easy to setup and go. Traipse also makes it easy for developers to work on code without fear of sacrifice. 'Ornery-Orc' continues the trend of 'Grumpy' and adds fixes to the code. 'Ornery-Orc's main goal is to offer more advanced features and enhance the productivity of the user. Update Summary (Closing/Closed) New Features: New to Map, can re-order Grid, Miniatures, and Whiteboard layer draw order New to Server GUI, can now clear log Updates: Update to Warhammer PC Sheet. Rollers set as macros. Should work with little maintanence. Update to Browser Server window. Display rooms with ' " & cleaner Update to Server. Handles ' " & cleaner. Fixes: Fix to InterParse that was causing an Infernal Loop with Namespace Internal Fix to XML data, removed old Minidom and switched to Element Tree Fix to Server that was causing eternal attempt to find a Server ID, in Register Rooms thread Fix to metaservers.xml file not being created Fix to Single and Double quotes in Whiteboard text Fix to Background images not showing when using the Image Server Fix to Duplicate chat names appearing Fix to Server GUI's logging output Fix to FNB.COLORFUL_TABS bug Fix to Gametree for XSLT Sheets
author sirebral
date Sat, 19 Jun 2010 10:17:24 -0500
parents 9230a33defd9
children 72e0cce81a47
line wrap: on
line diff
--- a/orpg/tools/InterParse.py	Wed Jun 16 03:11:55 2010 -0500
+++ b/orpg/tools/InterParse.py	Sat Jun 19 10:17:24 2010 -0500
@@ -48,8 +48,8 @@
         'Nodes now parse through ParsLogic. Easily add new parse rules right here!!'
         s = self.NameSpaceE(s)
         s = self.NameSpaceI(s, node)
-        s = self.NodeMap(s, node)
-        s = self.NodeParent(s, node)
+        #s = self.NodeMap(s, node)
+        #s = self.NodeParent(s, node)
         return s
 
     def Normalize(self, s, tab):
@@ -158,7 +158,13 @@
         anyone. Using !" :: "! will allow you to use an internal namespace from within another internal 
         namespace -- TaS, Prof. Ebral"""
         reg2 = re.compile("(!=(.*?)=!)")
-        matches = reg1.findall(s) + reg2.findall(s)
+        """Adding the Parent and Child references to Namespace Internal. Namespace 2.0 is powerful enough it
+        should be able to handle them with no problem. For future reference, if you are paying attention, Namespace
+        will include two methods for Internal and External. !@ :: @! and !& :: @! for External and !" :: "! and != :: =!
+        for Internal. See above Easter Egg for reasoning."""
+        reg3 = re.compile("(!!(.*?)!!)")
+        reg4 = re.compile("(!#(.*?)#!)")
+        matches = reg1.findall(s) + reg2.findall(s) + reg3.findall(s) + reg4.findall(s)
         try: tree_map = node.get('map')
         except: return node
         for i in xrange(0,len(matches)):
@@ -169,8 +175,9 @@
             node = self.get_node(new_map)
             newstr = self.LocationCheck(node, tree_map, new_map, find)
             s = s.replace(matches[i][0], newstr, 1)
-            s = self.NodeMap(s, node)
-            s = self.NodeParent(s, node)
+            s = s.replace(u'\xa0', ' ')
+            #s = self.NodeMap(s, node)
+            #s = self.NodeParent(s, node)
         return s
 
     def NameSpaceE(self, s):
@@ -206,6 +213,7 @@
                             else: break
             if not newstr: newstr = 'Invalid Reference!'
             s = s.replace(matches[i][0], newstr, 1)
+            s = s.replace(u'\xa0', ' ') #Required for XSLT sheets
             s = self.ParseLogic(s, node)
         return s
 
@@ -226,11 +234,12 @@
         matches = reg.findall(s)
         for i in xrange(0,len(matches)):
             tree_map = node.get('map')
-            tree_map = tree_map + '::' + matches[i][1]
-            newstr = '!@'+ tree_map +'@!'
+            tree_map = str(tree_map + '::' + matches[i][1])
+            if tree_map[:2] == '::': tree_map = tree_map[2:]
+            newstr = '!@'+ str(tree_map) +'@!'
             s = s.replace(matches[i][0], newstr, 1)
             s = self.Node(s)
-            s = self.NodeParent(s, tree_map)
+            s = self.NodeParent(s, node)
         return s
 
     def NodeParent(self, s, node):