wmllint-1.4: replaced backticks with repr()

This commit is contained in:
Elvish_Hunter 2015-08-31 21:35:19 +02:00
parent 50aeac6e30
commit 8db92e9af3

View file

@ -429,7 +429,7 @@ def maptransform1(filename, baseline, inmap, y):
inmap[y][x] = format % conversion1[field]
else:
raise maptransform_error(filename, baseline+y+1,
"unrecognized map element %s at (%s, %s)" % (`field`, x, y))
"unrecognized map element %s at (%s, %s)" % (repr(field), x, y))
# Mostly 1.3.1 -> 1.3.2 terrain conversions.
# One 1.3.13 -> 1.3.14 conversion -- old windmill terrain to stock villages.
@ -991,7 +991,7 @@ def hack_syntax(filename, lines):
if "no-icon" not in comment:
new_line = leader(lines[j]) + "description=_"+description+'\n'
if verbose:
print('"%s", line %d: inserting %s' % (filename, i+1, `new_line`))
print('"%s", line %d: inserting %s' % (filename, i+1, repr(new_line)))
lines.insert(j+1, new_line)
j += 1
modcount += 1
@ -1124,7 +1124,7 @@ def hack_syntax(filename, lines):
self.animend = None
self.attackend = None
def __repr__(self):
return `self.__dict__`
return repr(self.__dict__)
in_attack = in_animation = in_female = in_variation = False
animations = []
attackname = None
@ -1195,7 +1195,7 @@ def hack_syntax(filename, lines):
# Only pick up the *first* name field in an attack block;
# by convention, it will be right after the opening [attack] tag
elif in_attack and not in_animation and not attackname:
#print(filename + ":" + `i+1` + ";" + `lines[i]`)
#print(filename + ":" + repr(i+1) + ";" + repr(lines[i]))
fields = lines[i].strip().split('#')
syntactic = fields[0]
comment = ""
@ -1294,7 +1294,7 @@ def hack_syntax(filename, lines):
elif "[/effect]" in lines[i]:
converting = in_effect = False
elif in_effect and not attackname:
#print(filename + ":" + `i+1` + ";" + `lines[i]`)
#print(filename + ":" + repr(i+1) + ";" + repr(lines[i]))
fields = lines[i].strip().split('#')
syntactic = fields[0]
comment = ""
@ -2278,7 +2278,7 @@ if __name__ == '__main__':
ofp.write(changed)
ofp.close()
except maptransform_error, e:
print("wmllint: " + `e`, file=sys.stderr)
print("wmllint: " + repr(e), file=sys.stderr)
except:
print("wmllint: internal error on %s" % fn, file=sys.stderr)
(exc_type, exc_value, exc_traceback) = sys.exc_info()