MCPcopy Index your code
hub / github.com/python/cpython / get_extended_attribute

Function get_extended_attribute

Lib/email/_header_value_parser.py:2413–2433  ·  view source on GitHub ↗

[CFWS] 1*extended_attrtext [CFWS] This is like the non-extended version except we allow % characters, so that we can pick up an encoded value as a single string.

(value)

Source from the content-addressed store, hash-verified

2411 return attrtext, value
2412
2413def get_extended_attribute(value):
2414 """ [CFWS] 1*extended_attrtext [CFWS]
2415
2416 This is like the non-extended version except we allow % characters, so that
2417 we can pick up an encoded value as a single string.
2418
2419 """
2420 # XXX: should we have an ExtendedAttribute TokenList?
2421 attribute = Attribute()
2422 if value and value[0] in CFWS_LEADER:
2423 token, value = get_cfws(value)
2424 attribute.append(token)
2425 if value and value[0] in EXTENDED_ATTRIBUTE_ENDS:
2426 raise errors.HeaderParseError(
2427 "expected token but found '{}'".format(value))
2428 token, value = get_extended_attrtext(value)
2429 attribute.append(token)
2430 if value and value[0] in CFWS_LEADER:
2431 token, value = get_cfws(value)
2432 attribute.append(token)
2433 return attribute, value
2434
2435def get_section(value):
2436 """ '*' digits

Callers 1

get_valueFunction · 0.85

Calls 5

AttributeClass · 0.85
get_cfwsFunction · 0.85
get_extended_attrtextFunction · 0.85
appendMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…