attrtext = 1*(any non-ATTRIBUTE_ENDS character plus '%') This is a special parsing routine so that we get a value that includes % escapes as a single string (which we decode as a single string later).
(value)
| 2350 | return attribute, value |
| 2351 | |
| 2352 | def get_extended_attrtext(value): |
| 2353 | """attrtext = 1*(any non-ATTRIBUTE_ENDS character plus '%') |
| 2354 | |
| 2355 | This is a special parsing routine so that we get a value that |
| 2356 | includes % escapes as a single string (which we decode as a single |
| 2357 | string later). |
| 2358 | |
| 2359 | """ |
| 2360 | m = _non_extended_attribute_end_matcher(value) |
| 2361 | if not m: |
| 2362 | raise errors.HeaderParseError( |
| 2363 | "expected extended attrtext but found {!r}".format(value)) |
| 2364 | attrtext = m.group() |
| 2365 | value = value[len(attrtext):] |
| 2366 | attrtext = ValueTerminal(attrtext, 'extended-attrtext') |
| 2367 | _validate_xtext(attrtext) |
| 2368 | return attrtext, value |
| 2369 | |
| 2370 | def get_extended_attribute(value): |
| 2371 | """ [CFWS] 1*extended_attrtext [CFWS] |
no test coverage detected