MCPcopy Index your code
hub / github.com/RustPython/RustPython / get_attrtext

Function get_attrtext

Lib/email/_header_value_parser.py:2310–2327  ·  view source on GitHub ↗

attrtext = 1*(any non-ATTRIBUTE_ENDS character) We allow any non-ATTRIBUTE_ENDS in attrtext, but add defects to the token's defects list if we find non-attrtext characters. We also register defects for *any* non-printables even though the RFC doesn't exclude all of them, because we

(value)

Source from the content-addressed store, hash-verified

2308 return mtoken, value
2309
2310def get_attrtext(value):
2311 """attrtext = 1*(any non-ATTRIBUTE_ENDS character)
2312
2313 We allow any non-ATTRIBUTE_ENDS in attrtext, but add defects to the
2314 token's defects list if we find non-attrtext characters. We also register
2315 defects for *any* non-printables even though the RFC doesn't exclude all of
2316 them, because we follow the spirit of RFC 5322.
2317
2318 """
2319 m = _non_attribute_end_matcher(value)
2320 if not m:
2321 raise errors.HeaderParseError(
2322 "expected attrtext but found {!r}".format(value))
2323 attrtext = m.group()
2324 value = value[len(attrtext):]
2325 attrtext = ValueTerminal(attrtext, 'attrtext')
2326 _validate_xtext(attrtext)
2327 return attrtext, value
2328
2329def get_attribute(value):
2330 """ [CFWS] 1*attrtext [CFWS]

Callers 2

get_attributeFunction · 0.85
get_parameterFunction · 0.85

Calls 5

lenFunction · 0.85
ValueTerminalClass · 0.85
_validate_xtextFunction · 0.85
formatMethod · 0.45
groupMethod · 0.45

Tested by

no test coverage detected