Try to fix another minor bug in generated indentation.

This commit is contained in:
Eric S. Raymond 2007-10-05 18:51:47 +00:00
parent 4657f5ddf6
commit 5a927b87cb

View File

@ -929,7 +929,8 @@ def hack_syntax(filename, lines):
print '"%s", %d: %s' % (filename, dup, key)
if future:
# Lift obsolete image_short and image_long tags
expanded = """[animation]
expanded = """\
[animation]
apply_to=attack
[frame]
duration=300
@ -943,12 +944,12 @@ range=%s
for i in range(len(lines)):
if "no-syntax-rewrite" in lines[i]:
break
m = re.search(r"(\s)image_short=(.*)", lines[i])
m = re.search(r"(\s+)image_short=(.*)", lines[i])
if m:
image_block = expanded.replace("\n", "\n" + m.group(1))
lines[i] = m.group(1) + image_block % (m.group(2), "melee")
modcount += 1
m = re.search(r"(\s)image_long=(.*)", lines[i])
m = re.search(r"(\s+)image_long=(.*)", lines[i])
if m:
image_block = expanded.replace("\n", "\n" + m.group(1))
lines[i] = m.group(1) + image_block % (m.group(2), "ranged")