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

Function get_value

Lib/email/_header_value_parser.py:2422–2442  ·  view source on GitHub ↗

quoted-string / attribute

(value)

Source from the content-addressed store, hash-verified

2420
2421
2422def get_value(value):
2423 """ quoted-string / attribute
2424
2425 """
2426 v = Value()
2427 if not value:
2428 raise errors.HeaderParseError("Expected value but found end of string")
2429 leader = None
2430 if value[0] in CFWS_LEADER:
2431 leader, value = get_cfws(value)
2432 if not value:
2433 raise errors.HeaderParseError("Expected value but found "
2434 "only {}".format(leader))
2435 if value[0] == '"':
2436 token, value = get_quoted_string(value)
2437 else:
2438 token, value = get_extended_attribute(value)
2439 if leader is not None:
2440 token[:0] = [leader]
2441 v.append(token)
2442 return v, value
2443
2444def get_parameter(value):
2445 """ attribute [section] ["*"] [CFWS] "=" value

Callers 1

get_parameterFunction · 0.70

Calls 6

get_cfwsFunction · 0.85
get_quoted_stringFunction · 0.85
get_extended_attributeFunction · 0.85
ValueClass · 0.70
formatMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected