Mercurial > p > roundup > code
comparison roundup/cgi/TAL/markupbase.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 | 8c2402a78bb0 |
| children |
comparison
equal
deleted
inserted
replaced
| 5376:64b05e24dbd8 | 5377:12fe83f90f0d |
|---|---|
| 90 j = self._parse_doctype_subset(j + 1, i) | 90 j = self._parse_doctype_subset(j + 1, i) |
| 91 else: | 91 else: |
| 92 self.error("unexpected '[' char in declaration") | 92 self.error("unexpected '[' char in declaration") |
| 93 else: | 93 else: |
| 94 self.error( | 94 self.error( |
| 95 "unexpected %s char in declaration" % `rawdata[j]`) | 95 "unexpected %s char in declaration" % repr(rawdata[j])) |
| 96 if j < 0: | 96 if j < 0: |
| 97 return j | 97 return j |
| 98 return -1 # incomplete | 98 return -1 # incomplete |
| 99 | 99 |
| 100 # Internal -- scan past the internal subset in a <!DOCTYPE declaration, | 100 # Internal -- scan past the internal subset in a <!DOCTYPE declaration, |
| 111 # end of buffer; incomplete | 111 # end of buffer; incomplete |
| 112 return -1 | 112 return -1 |
| 113 if s != "<!": | 113 if s != "<!": |
| 114 self.updatepos(declstartpos, j + 1) | 114 self.updatepos(declstartpos, j + 1) |
| 115 self.error("unexpected char in internal subset (in %s)" | 115 self.error("unexpected char in internal subset (in %s)" |
| 116 % `s`) | 116 % repr(s)) |
| 117 if (j + 2) == n: | 117 if (j + 2) == n: |
| 118 # end of buffer; incomplete | 118 # end of buffer; incomplete |
| 119 return -1 | 119 return -1 |
| 120 if (j + 4) > n: | 120 if (j + 4) > n: |
| 121 # end of buffer; incomplete | 121 # end of buffer; incomplete |
| 129 if j == -1: | 129 if j == -1: |
| 130 return -1 | 130 return -1 |
| 131 if name not in ("attlist", "element", "entity", "notation"): | 131 if name not in ("attlist", "element", "entity", "notation"): |
| 132 self.updatepos(declstartpos, j + 2) | 132 self.updatepos(declstartpos, j + 2) |
| 133 self.error( | 133 self.error( |
| 134 "unknown declaration %s in internal subset" % `name`) | 134 "unknown declaration %s in internal subset" % repr(name)) |
| 135 # handle the individual names | 135 # handle the individual names |
| 136 meth = getattr(self, "_parse_doctype_" + name) | 136 meth = getattr(self, "_parse_doctype_" + name) |
| 137 j = meth(j, declstartpos) | 137 j = meth(j, declstartpos) |
| 138 if j < 0: | 138 if j < 0: |
| 139 return j | 139 return j |
| 160 return -1 | 160 return -1 |
| 161 elif c in string.whitespace: | 161 elif c in string.whitespace: |
| 162 j = j + 1 | 162 j = j + 1 |
| 163 else: | 163 else: |
| 164 self.updatepos(declstartpos, j) | 164 self.updatepos(declstartpos, j) |
| 165 self.error("unexpected char %s in internal subset" % `c`) | 165 self.error("unexpected char %s in internal subset" % repr(c)) |
| 166 # end of buffer reached | 166 # end of buffer reached |
| 167 return -1 | 167 return -1 |
| 168 | 168 |
| 169 # Internal -- scan past <!ELEMENT declarations | 169 # Internal -- scan past <!ELEMENT declarations |
| 170 def _parse_doctype_element(self, i, declstartpos): | 170 def _parse_doctype_element(self, i, declstartpos): |
