Author: esr
Date: Mon Mar 10 03:54:42 2008
New Revision: 24466
URL: http://svn.gna.org/viewcvs/wesnoth?rev=24466&view=rev
Log:
Add a --stringfreeze option.
Modified:
trunk/data/tools/wmllint
Modified: trunk/data/tools/wmllint
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/data/tools/wmllint?rev=24466&r1=24465&r2=24466&view=diff
==============================================================================
--- trunk/data/tools/wmllint (original)
+++ trunk/data/tools/wmllint Mon Mar 10 03:54:42 2008
@@ -73,8 +73,10 @@
# Note that this will also disable stack-based validation on the span
# of lines they enclose.
#
-# You can suppress warnings about newlines in messages with "wmllint:
-# display on", and re-enable them with "wmllint: display off".
+# You can suppress warnings about newlines in messages (and attempts to
+# replair them) with "wmllint: display on", and re-enable them with
+# "wmllint: display off". The repair attempts (only) may also be
+# suppressed with the --stringfreeze option.
import sys, os, re, getopt, string, copy, difflib, time
from wesnoth.wmltools import *
@@ -696,7 +698,7 @@
except TypeError:
pass
# Sanity-check recruit and recruitment_pattern.
- # This code has a limitation; if there arre multiple instances of
+ # This code has a limitation; if there are multiple instances of
# recruit and recruitment_pattern (as can happen if these lists
# vary by EASY/NORMAL/HARD level) this code will only record the
# last of each for later consistency checking.
@@ -828,7 +830,8 @@
if nv != value:
print '"%s", line %d: double space after sentence end' \
% (filename, i+1)
- lines[i] = sentence_end.sub(" ", lines[i])
+ 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' \
@@ -1912,6 +1915,7 @@
future = False
oldversion = 'older'
revert = False
+ stringfreeze = False
stripcr = False
upconvert = True
verbose = 0
@@ -1936,6 +1940,8 @@
revert = True
elif switch in ('-s', '--stripcr'):
stripcr = True
+ elif switch in ('-S', '--stringfreeze'):
+ stringfreeze = True
elif switch in ('-v', '--verbose'):
verbose += 1
if clean and revert:
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits