(self, boundary)
| 1243 | |
| 1244 | class MPBodyMarkup: |
| 1245 | def __init__(self, boundary): |
| 1246 | self.markups = [] |
| 1247 | self.error = None |
| 1248 | if CR in boundary: |
| 1249 | raise HTTPError(422, 'The `CR` must not be in the boundary: %s' % boundary) |
| 1250 | boundary = HYPHENx2 + boundary |
| 1251 | self.boundary = boundary |
| 1252 | token = CRLF + boundary |
| 1253 | self.tlen = len(token) |
| 1254 | self.token = token |
| 1255 | self.trest = self.trest_len = None |
| 1256 | self.abspos = 0 |
| 1257 | self.abs_start_section = 0 |
| 1258 | self.headers_eater = MPHeadersEaeter() |
| 1259 | self.cur_meth = self._eat_start_boundary |
| 1260 | self._eat_headers = self.headers_eater.eat |
| 1261 | self.stopped = False |
| 1262 | self.idx = idx = defaultdict(list) # 1-based indices for each token symbol |
| 1263 | for i, c in enumerate(token, start=1): |
| 1264 | idx[c].append([i, token[:i]]) |
| 1265 | |
| 1266 | def _match_tail(self, s, start, end): |
| 1267 | idxs = self.idx.get(s[end - 1]) |
nothing calls this directly
no test coverage detected