mail[Wesnoth-commits] r24618 - in /trunk/data: campaigns/Eastern_Invasion/scenarios/ campaigns/Liberty/scenarios/ campaigns/Sceptre_of_Fire/scenar...


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

Header


Content

Posted by esr on March 13, 2008 - 19:38:
Author: esr
Date: Thu Mar 13 19:21:26 2008
New Revision: 24618

URL: http://svn.gna.org/viewcvs/wesnoth?rev=24618&view=rev
Log:
Remove some id declarations that (a) confuse wmllint, and (b) are
ignored by the WML engine.

Modified:
    trunk/data/campaigns/Eastern_Invasion/scenarios/18a.The_Duel.cfg
    trunk/data/campaigns/Liberty/scenarios/07_The_Hunters.cfg
    trunk/data/campaigns/Sceptre_of_Fire/scenarios/4_Gathering_Materials.cfg
    trunk/data/campaigns/The_South_Guard/scenarios/05_Choice_In_The_Fog.cfg
    trunk/data/campaigns/Two_Brothers/scenarios/2_The_Chase.cfg
    trunk/data/tools/wmllint

Modified: trunk/data/campaigns/Eastern_Invasion/scenarios/18a.The_Duel.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Eastern_Invasion/scenarios/18a.The_Duel.cfg?rev=24618&r1=24617&r2=24618&view=diff
==============================================================================
--- trunk/data/campaigns/Eastern_Invasion/scenarios/18a.The_Duel.cfg 
(original)
+++ trunk/data/campaigns/Eastern_Invasion/scenarios/18a.The_Duel.cfg Thu Mar 
13 19:21:26 2008
@@ -51,6 +51,8 @@
     [event]
         name=start
                # Fix 11242, remove Owaec and Dacyn from recall list for the 
duration of the duel
+               # wmllint: recognize Owaec
+               # wmllint: recognize Dacyn
                [store_unit]
                        [filter]
                                id=Owaec

Modified: trunk/data/campaigns/Liberty/scenarios/07_The_Hunters.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Liberty/scenarios/07_The_Hunters.cfg?rev=24618&r1=24617&r2=24618&view=diff
==============================================================================
--- trunk/data/campaigns/Liberty/scenarios/07_The_Hunters.cfg (original)
+++ trunk/data/campaigns/Liberty/scenarios/07_The_Hunters.cfg Thu Mar 13 
19:21:26 2008
@@ -291,7 +291,6 @@
             x,y=31,18
         [/filter]
         [message]
-            id=fire_hot
             speaker=unit
             message= _ "Ow! Fire hot! No step in fire!"
         [/message]

Modified: 
trunk/data/campaigns/Sceptre_of_Fire/scenarios/4_Gathering_Materials.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Sceptre_of_Fire/scenarios/4_Gathering_Materials.cfg?rev=24618&r1=24617&r2=24618&view=diff
==============================================================================
--- trunk/data/campaigns/Sceptre_of_Fire/scenarios/4_Gathering_Materials.cfg 
(original)
+++ trunk/data/campaigns/Sceptre_of_Fire/scenarios/4_Gathering_Materials.cfg 
Thu Mar 13 19:21:26 2008
@@ -7,11 +7,9 @@
 
     [generator]
         [settings]
-            id=4_Gathering_Materials
             name= _ "Gathering Materials"
             {TURNS 40 37 34}
             victory_when_enemies_defeated=no
-            next_scenario=4t_The_Jeweler
 
             {SCENARIO_MUSIC underground.ogg}
 

Modified: 
trunk/data/campaigns/The_South_Guard/scenarios/05_Choice_In_The_Fog.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/The_South_Guard/scenarios/05_Choice_In_The_Fog.cfg?rev=24618&r1=24617&r2=24618&view=diff
==============================================================================
--- trunk/data/campaigns/The_South_Guard/scenarios/05_Choice_In_The_Fog.cfg 
(original)
+++ trunk/data/campaigns/The_South_Guard/scenarios/05_Choice_In_The_Fog.cfg 
Thu Mar 13 19:21:26 2008
@@ -429,7 +429,6 @@
             speaker=Deoran
             message= _ "Hmm...I have to consider this..."
             [option]
-                id=accept_bandits
                 message= _ "Very well. All men must unite against the 
undead."
                 [command]
                     [music]
@@ -566,7 +565,6 @@
             [/option]
 
             [option]
-                id=reject_bandits
                 message= _ "Your crimes are too great. You will fall with 
the rest of the foul undead!"
                 [command]
                     [music]

Modified: trunk/data/campaigns/Two_Brothers/scenarios/2_The_Chase.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Two_Brothers/scenarios/2_The_Chase.cfg?rev=24618&r1=24617&r2=24618&view=diff
==============================================================================
--- trunk/data/campaigns/Two_Brothers/scenarios/2_The_Chase.cfg (original)
+++ trunk/data/campaigns/Two_Brothers/scenarios/2_The_Chase.cfg Thu Mar 13 
19:21:26 2008
@@ -404,7 +404,6 @@
             speaker=Arne
             message= _ "I am the one to decide."
             [option]
-                id=get_heavy_inf
                 message= _ "Oh, all right then. Come along with us."
                 [command]
                     [message]
@@ -417,7 +416,6 @@
                 [/command]
             [/option]
             [option]
-                id=fast_gold
                 message= _ "I am sorry. We have not the time to spare."
                 [command]
                     [message]

Modified: trunk/data/tools/wmllint
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/tools/wmllint?rev=24618&r1=24617&r2=24618&view=diff
==============================================================================
--- trunk/data/tools/wmllint (original)
+++ trunk/data/tools/wmllint Thu Mar 13 19:21:26 2008
@@ -797,30 +797,39 @@
         m = re.match('# *wmllint: usage of "([^"]*)" is +(.*)', lines[i])
         if m:
             usage[m.group(1)] = m.group(2).strip()
-    # Consistency-check the description attributes in [side], [unit], 
[recall],
+    # Consistency-check the id= attributes in [side], [unit], [recall],
     # and [message] scopes, also correctness-check translation marks and look
     # for double spaces at end of sentence.
     unmodified = copy.copy(lines)
     present = []
     in_scenario = False
     in_person = False
-    in_objective = False
     in_trait = False
+    ignore_id = False
+    in_object = False
     ignoreable = False
+    preamble_seen = False
     sentence_end = re.compile("(?<=[.!?;:])  +")
     for i in range(len(lines)):
+        if '[' in lines[i]:
+            preamble_seen = True
         if "[scenario]" in lines[i]:
             in_scenario = True
+            preamble_seen = False
         elif "[/scenario]" in lines[i]:
             in_scenario = False
-        elif "[objective]" in lines[i]:
-            in_objective = True
-        elif "[/objective]" in lines[i]:
-            in_objective = False
         elif "[trait]" in lines[i]:
             in_trait = True
         elif "[/trait]" in lines[i]:
             in_trait = False
+        elif "[object]" in lines[i]:
+            in_object = True
+        elif "[/object]" in lines[i]:
+            in_object = False
+        elif "[label]" in lines[i] or "[chamber]" in lines[i] or "[time]" in 
lines[i]:
+            ignore_id = True
+        elif "[/label]" in lines[i] or "[/chamber]" in lines[i] or "[/time]" 
in lines[i]:
+            ignore_id = False
         elif "[kill]" in lines[i] or "[effect]" in lines[i] or 
"[move_unit_fake]" in lines[i] or "[scroll_to_unit]" in lines[i]:
             ignoreable = True
         elif "[/kill]" in lines[i] or "[/effect]" in lines[i] or 
"[/move_unit_fake]" in lines[i] or "[/scroll_to_unit]" in lines[i]:
@@ -858,7 +867,7 @@
                 pass
             elif key == 'name':                # FIXME: check this someday
                 pass
-            elif key in ("message", "user_description", "story", "note", 
"text", "summary", "caption", "label", "unit_description", 
"cannot_use_message", "set_description") and not value.startswith("$"):
+            elif key in ("message", "description", "user_description", 
"story", "note", "text", "summary", "caption", "label", "unit_description", 
"cannot_use_message", "set_description") and not value.startswith("$"):
                 if not has_tr_mark:
                     print '"%s", line %d: %s needs translation mark' \
                           % (filename, i+1, key)
@@ -869,26 +878,19 @@
                           % (filename, i+1)
                     if not stringfreeze:
                         lines[i] = sentence_end.sub(" ", lines[i])
-            elif  key == "description":
-                if (in_trait or in_objective) and not has_tr_mark:
-                    print '"%s", line %d: description in [objectives] needs 
translation mark' \
-                          % (filename, i+1)
-                    lines[i] = sentence_end.sub(" ", lines[i])
-                elif not (in_trait or in_objective) and has_tr_mark:
-                    print '"%s", line %d: description should not have 
translation mark' \
-                          % (filename, i+1)
+            else:
+                if key == "id":
+                    if in_person:
+                        present.append(value)
+                    elif value in ('narrator', 'unit', 'second_unit') or 
value[0] in ("$", "{"):
+                        continue
+                    elif preamble_seen and not ignore_id and not in_object 
and not value in present:
+                        print '"%s", line %d: unknown \'%s\' referred to by 
id' \
+                              % (filename, i+1, value)
+                if has_tr_mark:
+                    print '"%s", line %d: %s should not have a translation 
mark' \
+                              % (filename, i+1, key)                
                     lines[i] = lines[i].replace("_", "", 1)
-                if in_person:
-                    present.append(value)
-                elif value in ('narrator', 'unit', 'second_unit') or 
value[0] in ("$", "{"):
-                    continue
-                elif not in_objective and value not in present:
-                    print '"%s", line %d: unknown \'%s\' referred to by 
description' \
-                          % (filename, i+1, value)
-            elif has_tr_mark:
-                print '"%s", line %d: %s should not have a translation mark' 
\
-                          % (filename, i+1, key)                
-                lines[i] = lines[i].replace("_", "", 1)
         except TypeError:
             pass
     # Check for textdomain strings; should be exactly one, on line 1




Related Messages


Powered by MHonArc, Updated Thu Mar 13 20:01:22 2008