bugfix insertion of attack's description= key

First, the newline is added to "description = " rather than "new_line = ". But description was only changed if it didn't begin with a quotemark, meaning that those that *did* start with a quote weren't getting a newline.

Second, new_line was supposed to inherit indentation through "leader(syntactic)", but the line had already been stripped before "syntactic", in "fields = ".
This commit is contained in:
Groggy Dice 2013-07-13 09:25:31 -04:00
parent 7ac9e55a8d
commit 7fe4536910

View file

@ -974,11 +974,11 @@ def hack_syntax(filename, lines):
if syntactic.strip().startswith("name"):
description = syntactic.split("=")[1].strip()
if not description.startswith('"'):
description = '"' + description + '"\n'
description = '"' + description + '"'
# Skip the insertion if this is a dummy declaration
# or one modifying an attack inherited from a base unit.
if "no-icon" not in comment:
new_line = leader(syntactic) + "description=_"+description
new_line = leader(lines[j]) + "description=_"+description+'\n'
if verbose:
print '"%s", line %d: inserting %s' % (filename, i+1, `new_line`)
lines.insert(j+1, new_line)