From f6630cdca55d2bbcc5aeb6cd6cedcf8fda26048c Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Fri, 5 Oct 2007 20:05:11 +0000 Subject: [PATCH] wmllint code for bug #10089 confirmed correct, I'm removing the conditionalization by --future. --- data/tools/wmllint | 49 +++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/data/tools/wmllint b/data/tools/wmllint index d26c775ac46..8c1d45ad122 100755 --- a/data/tools/wmllint +++ b/data/tools/wmllint @@ -927,34 +927,33 @@ def hack_syntax(filename, lines): print 'warning: duplicated attack %s at:' % key for dup in linenos: print '"%s", %d: %s' % (filename, dup, key) - if future: - # Lift obsolete image_short and image_long tags - expanded = """\ + # Lift obsolete image_short and image_long tags + expanded = """\ [attack_anim] - apply_to=attack - start_time=-150 - [frame] - duration=300 - image=%s - [/frame] - [attack_filter] - range=%s - [/attack_filter] +apply_to=attack +start_time=-150 +[frame] + duration=300 + image=%s +[/frame] +[attack_filter] + range=%s +[/attack_filter] [/attack_anim]\ """ - for i in range(len(lines)): - if "no-syntax-rewrite" in lines[i]: - break - m = re.search(r"(\s+)image_short=(.*)", lines[i]) - if m: - image_block = expanded.replace("\n", "\n" + m.group(1)) + "\n" - lines[i] = m.group(1) + image_block % (m.group(2), "melee") - modcount += 1 - m = re.search(r"(\s+)image_long=(.*)", lines[i]) - if m: - image_block = expanded.replace("\n", "\n" + m.group(1)) + "\n" - lines[i] = m.group(1) + image_block % (m.group(2), "ranged") - modcount += 1 + for i in range(len(lines)): + if "no-syntax-rewrite" in lines[i]: + break + m = re.search(r"(\s+)image_short=(.*)", lines[i]) + if m: + image_block = expanded.replace("\n", "\n" + m.group(1)) + "\n" + lines[i] = m.group(1) + image_block % (m.group(2), "melee") + modcount += 1 + m = re.search(r"(\s+)image_long=(.*)", lines[i]) + if m: + image_block = expanded.replace("\n", "\n" + m.group(1)) + "\n" + lines[i] = m.group(1) + image_block % (m.group(2), "ranged") + modcount += 1 # More syntax transformations would go here. return (lines, modcount)