mail[Wesnoth-commits] r24561 - in /trunk/data: campaigns/Son_Of_The_Black_Eye/scenarios/06_Black_Flag.cfg tools/wmllint


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

Header


Content

Posted by esr on March 12, 2008 - 12:06:
Author: esr
Date: Wed Mar 12 12:06:33 2008
New Revision: 24561

URL: http://svn.gna.org/viewcvs/wesnoth?rev=24561&view=rev
Log:
Fix archaic use of id= in [unit].

Modified:
    trunk/data/campaigns/Son_Of_The_Black_Eye/scenarios/06_Black_Flag.cfg
    trunk/data/tools/wmllint

Modified: 
trunk/data/campaigns/Son_Of_The_Black_Eye/scenarios/06_Black_Flag.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Son_Of_The_Black_Eye/scenarios/06_Black_Flag.cfg?rev=24561&r1=24560&r2=24561&view=diff
==============================================================================
--- trunk/data/campaigns/Son_Of_The_Black_Eye/scenarios/06_Black_Flag.cfg 
(original)
+++ trunk/data/campaigns/Son_Of_The_Black_Eye/scenarios/06_Black_Flag.cfg Wed 
Mar 12 12:06:33 2008
@@ -209,7 +209,7 @@
         {PIRATE_GALLEON 6 25}
         [unit]
             side=3
-            id=Transport
+            type=Transport
             description="Transport Galleon"
             user_description= _ "Transport Galleon"
             type=Transport Galleon

Modified: trunk/data/tools/wmllint
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/tools/wmllint?rev=24561&r1=24560&r2=24561&view=diff
==============================================================================
--- trunk/data/tools/wmllint (original)
+++ trunk/data/tools/wmllint Wed Mar 12 12:06:33 2008
@@ -1510,7 +1510,33 @@
         if "[/terrain]" in lines[i]:
             in_terrain = False
         if in_terrain:
-            lines[i] = lines[i].replace("letter", "terrain")
+            nl = lines[i].replace("letter", "terrain")
+            if nl != lines[i]:
+                modcount += 1
+                lines[i] = nl
+    # id= -> type= in [unit]
+    if upconvert and "1.3.14" in versions:
+        in_unit = False
+        id_seen = False
+        in_modifications = False
+        for i in range(len(lines)):
+            if "no-syntax-rewrite" in lines[i]:
+                break
+            if "[unit]" in lines[i]:
+                in_unit = True
+            if "[/unit]" in lines[i]:
+                in_unit = False
+            if "[modifications]" in lines[i]:
+                in_modifications = True
+            if "[/modifications]" in lines[i]:
+                in_modifications = False
+            if in_unit and not in_modifications and not id_seen and 
re.search("id *=", lines[i]):
+                nl = re.sub("id *=", "type=", lines[i])
+                if nl != lines[i]:
+                    modcount += 1
+                    lines[i] = nl
+                    print '"%s", line %d: [unit] id= -> type=' % (filename, 
i+1)
+                id_seen = True            
     # More syntax transformations would go here.
     return (lines, modcount)
 




Related Messages


Powered by MHonArc, Updated Wed Mar 12 12:41:01 2008