Remove W604 pep8 warning on files. Use repr(x) instead of deprecated

This commit is contained in:
Thibault Févry 2011-03-25 20:46:50 +00:00
parent 3b7e87fc93
commit 6674487fb0
8 changed files with 11 additions and 11 deletions

View File

@ -42,6 +42,6 @@ for line in sys.stdin:
try:
(key, value) = line.split("=")
except ValueError:
print >>sys.stderr, "Malformed line: %s" % `line`
print >>sys.stderr, "Malformed line: %s" % repr(line)
sys.exit(1)
entry[key] = value

View File

@ -40,4 +40,4 @@ print basecolors
for (filename, colors) in subtracted:
print filename + ":"
for (n, rgb) in colors:
print `rgb` + " * " + `n`
print repr(rgb) + " * " + repr(n)

View File

@ -351,10 +351,10 @@ class JourneyTracks:
self.tracks[self.selected_id] = track[:found[-1]] + track[found[-1]+1:]
self.modified += 1
def __str__(self):
rep = self.mapfile + `self.track_order`+ "\n"
rep = self.mapfile + repr(self.track_order) + "\n"
for name in self.track_order:
track = self.tracks[name]
rep += name + ": " + `track` + ":\n"
rep += name + ": " + repr(track) + ":\n"
return rep
class ContextPopup:

View File

@ -289,7 +289,7 @@ class Reference:
def dump_references(self):
"Dump all known references to this definition."
for (file, refs) in self.references.items():
print " %s: %s" % (file, `map(lambda x: x[0], refs)`[1:-1])
print " %s: %s" % (file, repr(map(lambda x: x[0], refs))[1:-1])
def __cmp__(self, other):
"Compare two documentation objects for place in the sort order."
# Major sort by file, minor by line number. This presumes that the
@ -367,7 +367,7 @@ class CrossRef:
latch_unit = in_base_unit = in_theme = False
for (n, line) in enumerate(dfp):
if self.warnlevel > 1:
print `line`[1:-1]
print repr(line)[1:-1]
if line.strip().startswith("#textdomain"):
continue
m = re.search("# *wmlscope: warnlevel ([0-9]*)", line)

View File

@ -314,8 +314,8 @@ if __name__ == '__main__':
# Perform the actual transformation
for (((xs, xe), (ys, ye)), (xn, yn)) in zip(pairs, target):
content = content[:ys] + `yn` + content[ye:]
content = content[:xs] + `xn` + content[xe:]
content = content[:ys] + repr(yn) + content[ye:]
content = content[:xs] + repr(xn) + content[xe:]
fp = open(filename, "w")
fp.write(content)

View File

@ -1449,7 +1449,7 @@ def hack_syntax(filename, lines):
if "no-icon" not in comment:
new_line = leader(syntactic) + "description=_"+description
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
j += 1

View File

@ -168,7 +168,7 @@ msgstr ""
opener_stack.pop()
elif inMacroContinuation(nav):
if verbose > 1:
print "In macro continuation", `nav.text`
print "In macro continuation", repr(nav.text)
nav.element = "argument"
get_translatables(nav, fn)
elif isInlineMacro(nav):

View File

@ -140,7 +140,7 @@ def maps(cfg):
mp = 1
while 1:
try:
yield cfg.get('default','map'+`mp`);
yield cfg.get('default','map' + repr(mp));
mp= mp+1
except:
return