mail[Wesnoth-commits] r20214 - /trunk/data/tools/wmllint


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by patrick_X99 on September 09, 2007 - 08:28:
Author: sapient
Date: Sun Sep  9 08:01:10 2007
New Revision: 20214

URL: http://svn.gna.org/viewcvs/wesnoth?rev=20214&view=rev
Log:
tie in the radius WmlIterator changes

Modified:
    trunk/data/tools/wmllint

Modified: trunk/data/tools/wmllint
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/tools/wmllint?rev=20214&r1=20213&r2=20214&view=diff
==============================================================================
--- trunk/data/tools/wmllint (original)
+++ trunk/data/tools/wmllint Sun Sep  9 08:01:10 2007
@@ -683,28 +683,30 @@
         radius_pos = wmlfind("radius=", WmlIterator(lines))
         while radius_pos is not None:
             scopeIter = radius_pos.iterScope()
-            startline = scopeIter.lineno()
-            wspace = radius_pos.text()
+            startline = scopeIter.lineno + 1
+            wspace = radius_pos.text
             wspace = wspace[:len(wspace)-len(wspace.lstrip())]
             radius_danger = False
             to_indent = []
             no_indent = []
-            for pos in scopeIter:
-                tag = pos.tag()
-                if tag in ("[and]", "[or]", "[not]"):
+            for i in scopeIter:
+                elem = i.element
+                if elem in ("[and]", "[or]", "[not]"):
                     radius_danger = True
-                    no_indent.extend(pos.text().splitlines())
-                elif tag in ("variable=", "side=", "count=", "adjacent="):
-                    no_indent.extend(pos.text().splitlines())
+                    no_indent.extend(i.text.splitlines())
+                elif elem in ("variable=", "side=", "count=", "adjacent="):
+                    no_indent.extend(i.text.splitlines())
                 else:
-                    to_add = pos.text().splitlines()
+                    to_add = i.text.splitlines()
                     to_add[0] = baseindent + to_add[0]
                     to_indent.extend(to_add)
             if radius_danger:
-                lines = lines[:startline] + [wspace + "[and]"] + to_indent +\
-                        [wspace + "[/and]"] + no_indent + 
lines[scopeIter.lineno():]
+                lines = lines[:startline] + [wspace + "[and]"] + to_indent +[
+                    wspace + "[/and]"] + no_indent + lines[scopeIter.lineno:]
                 modcount += 1
-            radius_pos = wmlfind("radius=", WmlIterator(lines, 
startline+len(to_indent)+1+radius_danger))
+                radius_pos = wmlfind("radius=", WmlIterator(lines, 
startline+len(to_indent)+1))
+            else:
+                radius_pos = wmlfind("radius=", radius_pos)
     # More syntax transformations would go here.
     return (lines, modcount)
 




Related Messages


Powered by MHonArc, Updated Sun Sep 09 09:00:51 2007