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

Method header_source_parse

Lib/email/policy.py:124–135  ·  view source on GitHub ↗

+ The name is parsed as everything up to the ':' and returned unmodified. The value is determined by stripping leading whitespace off the remainder of the first line joined with all subsequent lines, and stripping any trailing carriage return or linefeed characters.

(self, sourcelines)

Source from the content-addressed store, hash-verified

122 # applications only a few headers will actually be inspected.
123
124 def header_source_parse(self, sourcelines):
125 """+
126 The name is parsed as everything up to the ':' and returned unmodified.
127 The value is determined by stripping leading whitespace off the
128 remainder of the first line joined with all subsequent lines, and
129 stripping any trailing carriage return or linefeed characters. (This
130 is the same as Compat32).
131
132 """
133 name, value = sourcelines[0].split(':', 1)
134 value = ''.join((value, *sourcelines[1:])).lstrip(' \t\r\n')
135 return (name, value.rstrip('\r\n'))
136
137 def header_store_parse(self, name, value):
138 """+

Callers 2

_parse_headersMethod · 0.45
_prepare_setFunction · 0.45

Calls 4

splitMethod · 0.45
lstripMethod · 0.45
joinMethod · 0.45
rstripMethod · 0.45

Tested by

no test coverage detected