comparison roundup/cgi/TAL/TALDefs.py @ 5377:12fe83f90f0d

Python 3 preparation: use repr() instead of ``. Tool-generated patch.
author Joseph Myers <jsm@polyomino.org.uk>
date Tue, 24 Jul 2018 21:36:02 +0000
parents 63868084b8bb
children 0942fe89e82e
comparison
equal deleted inserted replaced
5376:64b05e24dbd8 5377:12fe83f90f0d
120 def parseAttributeReplacements(arg, xml): 120 def parseAttributeReplacements(arg, xml):
121 dict = {} 121 dict = {}
122 for part in splitParts(arg): 122 for part in splitParts(arg):
123 m = _attr_re.match(part) 123 m = _attr_re.match(part)
124 if not m: 124 if not m:
125 raise TALError("Bad syntax in attributes: " + `part`) 125 raise TALError("Bad syntax in attributes: " + repr(part))
126 name, expr = m.group(1, 2) 126 name, expr = m.group(1, 2)
127 if not xml: 127 if not xml:
128 name = name.lower() 128 name = name.lower()
129 if dict.has_key(name): 129 if dict.has_key(name):
130 raise TALError("Duplicate attribute name in attributes: " + `part`) 130 raise TALError("Duplicate attribute name in attributes: " + repr(part))
131 dict[name] = expr 131 dict[name] = expr
132 return dict 132 return dict
133 133
134 def parseSubstitution(arg, position=(None, None)): 134 def parseSubstitution(arg, position=(None, None)):
135 m = _subst_re.match(arg) 135 m = _subst_re.match(arg)
136 if not m: 136 if not m:
137 raise TALError("Bad syntax in substitution text: " + `arg`, position) 137 raise TALError("Bad syntax in substitution text: " + repr(arg), position)
138 key, expr = m.group(1, 2) 138 key, expr = m.group(1, 2)
139 if not key: 139 if not key:
140 key = "text" 140 key = "text"
141 return key, expr 141 return key, expr
142 142

Roundup Issue Tracker: http://roundup-tracker.org/