copy original wmllint 1.4 into data/tools
Since esr is overwhelmingly the predominant author of early wmllint, I am importing it in the form of a patch from him, so that git blame will bear some resemblance to reality. Those interested in the full development history should refer back to the 1.4 branch. git blame (without switches) ascribes the following lines to authors other than esr:48a82a6f5
data/tools/wmllint-1.4 (Elias Pschernig 2007-05-31 19:06:25 +0000 77) from wesnoth.wmltools import *4be7e8163
data/tools/wmllint-1.4 (Patrick Parker 2007-09-09 06:12:43 +0000 78) from wesnoth.wmliterator import *68cb53470
data/tools/wmllint-1.4 (Gunter Labes 2007-07-11 21:09:36 +0000 261) ("holy=", "arcane="),68cb53470
data/tools/wmllint-1.4 (Gunter Labes 2007-07-11 21:09:36 +0000 291) ),c15a9fc9a
data/tools/wmllint-1.4 (Gunter Labes 2007-09-20 16:43:35 +0000 295) ("Halbardier" , "Halberdier"),ea3323d98
data/tools/wmllint-1.4 (Patrick Parker 2007-09-06 01:57:09 +0000 948) global versionsd84b7f63b
data/tools/wmllint-1.4 (Jérémy Rosen 2007-09-08 07:51:22 +0000 1071) breakd84b7f63b
data/tools/wmllint-1.4 (Jérémy Rosen 2007-09-08 07:51:22 +0000 1206) # Garbage-collect any empty [attack] scopes left behind;d84b7f63b
data/tools/wmllint-1.4 (Jérémy Rosen 2007-09-08 07:51:22 +0000 1207) # this is likely to happen with female-variant units.d84b7f63b
data/tools/wmllint-1.4 (Jérémy Rosen 2007-09-08 07:51:22 +0000 1208) nullattack = Trued84b7f63b
data/tools/wmllint-1.4 (Jérémy Rosen 2007-09-08 07:51:22 +0000 1209) while nullattack:d84b7f63b
data/tools/wmllint-1.4 (Jérémy Rosen 2007-09-08 07:51:22 +0000 1210) nullattack = Falsed84b7f63b
data/tools/wmllint-1.4 (Jérémy Rosen 2007-09-08 07:51:22 +0000 1211) for i in range(len(lines)-1):d84b7f63b
data/tools/wmllint-1.4 (Jérémy Rosen 2007-09-08 07:51:22 +0000 1212) if lines[i].strip() == "[attack]" and lines[i+1].strip() == "[/attack]":d84b7f63b
data/tools/wmllint-1.4 (Jérémy Rosen 2007-09-08 07:51:22 +0000 1213) nullattack = Trued84b7f63b
data/tools/wmllint-1.4 (Jérémy Rosen 2007-09-08 07:51:22 +0000 1215) if nullattack:d84b7f63b
data/tools/wmllint-1.4 (Jérémy Rosen 2007-09-08 07:51:22 +0000 1216) lines = lines[:i] + lines[i+2:]e542a2ada
data/tools/wmllint-1.4 (Gunter Labes 2007-09-20 17:29:49 +0000 1469) name_pos = wmlfind("name=", WmlIterator(lines, filename))801aa3003
data/tools/wmllint-1.4 (Jérémy Rosen 2007-10-05 19:59:11 +0000 1487) [attack_anim]801aa3003
data/tools/wmllint-1.4 (Jérémy Rosen 2007-10-05 19:59:11 +0000 1497) [/attack_anim]\bc4e1d8f3
data/tools/wmllint-1.4 (Patrick Parker 2007-09-09 23:24:29 +0000 1552) except IndexError:bc4e1d8f3
data/tools/wmllint-1.4 (Patrick Parker 2007-09-09 23:24:29 +0000 1553) has_map_content = Falsea106067a8
data/tools/wmllint-1.4 (Mark de Wever 2007-05-27 16:19:33 +0000 1602) if not map_only:a106067a8
data/tools/wmllint-1.4 (Mark de Wever 2007-05-27 16:19:33 +0000 1603) line = mfile.pop(0)a106067a8
data/tools/wmllint-1.4 (Mark de Wever 2007-05-27 16:19:33 +0000 1604) if verbose >= 3:a106067a8
data/tools/wmllint-1.4 (Mark de Wever 2007-05-27 16:19:33 +0000 1605) sys.stdout.write(line + terminator)a106067a8
data/tools/wmllint-1.4 (Mark de Wever 2007-05-27 16:19:33 +0000 1606) lineno += 1176b29319
data/tools/wmllint-1.4 (Mark de Wever 2007-10-28 10:53:53 +0000 1725) # Strip the starting positions out of the edges176b29319
data/tools/wmllint-1.4 (Mark de Wever 2007-10-28 10:53:53 +0000 1726) outermap(lambda n: re.sub(r"[1-9] ", r"", n), outmap)bb07ea830
data/tools/wmllint-1.4 (Mark de Wever 2007-10-28 09:03:10 +0000 1728) outermap(lambda n: n.replace(r"Gg^Fet", r"Gs^Fp"), outmap)d725c7cdb
data/tools/wmllint-1.4 (Gunter Labes 2007-08-24 04:54:04 +0000 1883) Usage: wmllint [options] [dir]d725c7cdb
data/tools/wmllint-1.4 (Gunter Labes 2007-08-24 04:54:04 +0000 1885) Takes any number of directories as arguments. Each directory is converted.d725c7cdb
data/tools/wmllint-1.4 (Gunter Labes 2007-08-24 04:54:04 +0000 1886) If no directories are specified, acts on the current directory.d725c7cdb
data/tools/wmllint-1.4 (Gunter Labes 2007-08-24 04:54:04 +0000 1896) -D, --diff Display diffs between converted and unconverted files.ea3323d98
data/tools/wmllint-1.4 (Patrick Parker 2007-09-06 01:57:09 +0000 1903) global versions
This commit is contained in:
parent
ffb34c2ffa
commit
8b0bce5d15
1 changed files with 2139 additions and 0 deletions
2139
data/tools/wmllint-1.4
Normal file
2139
data/tools/wmllint-1.4
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue