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

Method header_source_parse

Lib/email/policy.py:118–129  ·  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

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

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