mail[Wesnoth-commits] r24556 - /trunk/data/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 - 09:38:
Author: esr
Date: Wed Mar 12 09:37:59 2008
New Revision: 24556

URL: http://svn.gna.org/viewcvs/wesnoth?rev=24556&view=rev
Log:
Variable name change.

Modified:
    trunk/data/tools/wmllint

Modified: trunk/data/tools/wmllint
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/tools/wmllint?rev=24556&r1=24555&r2=24556&view=diff
==============================================================================
--- trunk/data/tools/wmllint (original)
+++ trunk/data/tools/wmllint Wed Mar 12 09:37:59 2008
@@ -597,7 +597,7 @@
     # Sanity-check abilities and traits against notes macros.
     # Note: This check is disabled on units deived via [base_unit].
     # Also, build dictionaries of unit movement types and races
-    in_unit = False
+    in_unit_type = False
     in_attack_filter = False
     for i in range(len(lines)):
         if "[attack_filter]" in lines[i]:
@@ -611,11 +611,11 @@
             notes = []
             has_special_notes = False
             derived_unit = False
-            in_unit = i+1
+            in_unit_type = i+1
             continue
         elif "[/unit_type]" in lines[i]:
             #print '"%s", %d: unit has traits %s and notes %s' \
-            #      % (filename, in_unit, traits, notes)
+            #      % (filename, in_unit_type, traits, notes)
             if unit_id and not derived_unit:
                 missing_notes = []
                 for trait in traits:
@@ -631,19 +631,19 @@
                     missing_notes = ["{SPECIAL_NOTES}"] + missing_notes
                 if missing_notes:
                     print '"%s", line %d: unit %s is missing notes +%s' \
-                          % (filename, in_unit, unit_id, 
"+".join(missing_notes))
+                          % (filename, in_unit_type, unit_id, 
"+".join(missing_notes))
                 if missing_traits:
                     print '"%s", line %d: unit %s is missing traits %s' \
-                          % (filename, in_unit, unit_id, 
"+".join(missing_traits))
+                          % (filename, in_unit_type, unit_id, 
"+".join(missing_traits))
                 if not (notes or traits) and has_special_notes:
                     print '"%s", line %d: unit %s has superfluous 
{SPECIAL_NOTES}' \
-                          % (filename, in_unit, unit_id)
-            in_unit = None
+                          % (filename, in_unit_type, unit_id)
+            in_unit_type = None
             traits = []
             notes = []
             unit_id = ""
             has_special_notes = False
-        if in_unit and not in_attack_filter:
+        if in_unit_type and not in_attack_filter:
             try:
                 (key, prefix, value, comment) = parse_attribute(lines[i])
                 if key == "id" and not unit_id:
@@ -990,7 +990,7 @@
                 modcount += 1        
             need_image = in_message = False
     # Remove get_hit_sound fields
-    in_unit = False
+    in_unit_type = 0 
     unit_id = ""
     unit_image = None
     unit_sound = None
@@ -999,7 +999,7 @@
     has_special_notes = False
     for i in range(len(lines)):
         if "[unit_type]" in lines[i]:
-            in_unit = i+1
+            in_unit_type = i+1
             continue
         elif "[/unit_type]" in lines[i]:
             if unit_id and get_hit_sound:
@@ -1013,14 +1013,14 @@
                     lines[get_hit_sound] = leader(lines[get_hit_sound]) \
                                            + new_anim + comment
                     modcount += 1
-            in_unit = None
+            in_unit_type = None
             unit_id = ""
             unit_image = None
             unit_sound = None
             get_hit_sound = None
             has_defense_anim = False
             has_special_notes = False
-        if in_unit:
+        if in_unit_type:
             if "{DEFENSE_ANIM" in lines[i]:
                 has_defense_anim = True
             else:




Related Messages


Powered by MHonArc, Updated Wed Mar 12 10:22:22 2008