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

Function get_attribute

Lib/email/_header_value_parser.py:2329–2350  ·  view source on GitHub ↗

[CFWS] 1*attrtext [CFWS] This version of the BNF makes the CFWS explicit, and as usual we use a value terminal for the actual run of characters. The RFC equivalent of attrtext is the token characters, with the subtraction of '*', "'", and '%'. We include tab in the excluded set ju

(value)

Source from the content-addressed store, hash-verified

2327 return attrtext, value
2328
2329def get_attribute(value):
2330 """ [CFWS] 1*attrtext [CFWS]
2331
2332 This version of the BNF makes the CFWS explicit, and as usual we use a
2333 value terminal for the actual run of characters. The RFC equivalent of
2334 attrtext is the token characters, with the subtraction of '*', "'", and '%'.
2335 We include tab in the excluded set just as we do for token.
2336
2337 """
2338 attribute = Attribute()
2339 if value and value[0] in CFWS_LEADER:
2340 token, value = get_cfws(value)
2341 attribute.append(token)
2342 if value and value[0] in ATTRIBUTE_ENDS:
2343 raise errors.HeaderParseError(
2344 "expected token but found '{}'".format(value))
2345 token, value = get_attrtext(value)
2346 attribute.append(token)
2347 if value and value[0] in CFWS_LEADER:
2348 token, value = get_cfws(value)
2349 attribute.append(token)
2350 return attribute, value
2351
2352def get_extended_attrtext(value):
2353 """attrtext = 1*(any non-ATTRIBUTE_ENDS character plus '%')

Callers 1

get_parameterFunction · 0.70

Calls 5

AttributeClass · 0.85
get_cfwsFunction · 0.85
get_attrtextFunction · 0.85
appendMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected