Lines Matching refs:value
50 refold_source -- if the value for a header in the Message object
53 that value when transforming the message back into
65 'value', where 'name' is a header field name and
66 'value' is an unfolded header field value, and
121 The value is determined by stripping leading whitespace off the
127 name, value = sourcelines[0].split(':', 1)
128 value = value.lstrip(' \t') + ''.join(sourcelines[1:])
129 return (name, value.rstrip('\r\n'))
131 def header_store_parse(self, name, value):
133 The name is returned unchanged. If the input value has a 'name'
134 attribute and it matches the name ignoring case, the value is returned
135 unchanged. Otherwise the name and value are passed to header_factory
137 value. In this case a ValueError is raised if the input value contains
141 if hasattr(value, 'name') and value.name.lower() == name.lower():
142 return (name, value)
143 if isinstance(value, str) and len(value.splitlines())>1:
148 return (name, self.header_factory(name, value))
150 def header_fetch_parse(self, name, value):
152 If the value has a 'name' attribute, it is returned to unmodified.
153 Otherwise the name and the value with any linesep characters removed
159 if hasattr(value, 'name'):
160 return value
162 value = ''.join(linesep_splitter.split(value))
163 return self.header_factory(name, value)
165 def fold(self, name, value):
168 value is considered to be a 'source value' if and only if it does not
170 object of some sort). If a source value needs to be refolded according
172 the name and the value with any linesep characters removed to the
176 Source values are split into lines using splitlines. If the value is
179 binary data. In that case the value is refolded regardless of the
184 return self._fold(name, value, refold_binary=True)
186 def fold_binary(self, name, value):
188 The same as fold if cte_type is 7bit, except that the returned value is
200 folded = self._fold(name, value, refold_binary=self.cte_type=='7bit')
204 def _fold(self, name, value, refold_binary=False):
205 if hasattr(value, 'name'):
206 return value.fold(policy=self)
208 lines = value.splitlines()
213 if refold or refold_binary and _has_surrogates(value):