Lines Matching refs:line
23 This module does not do the line wrapping or end-of-line character
25 does dumb encoding and decoding. To deal with the various line
128 """Encode a single header line with quoted-printable (like) encoding.
156 Each line of encoded text will end with eol, which defaults to "\\n". Set
160 Each line will be wrapped at, at most, maxlinelen characters before the
162 permitted by RFC 2045). Long lines will have the 'soft line break'
167 followed by a soft line break. Smaller values will generate a
181 # leave space for the '=' at the end of a line
187 for line in body.splitlines():
188 # break up the line into pieces no longer than maxlinelen - 1
190 laststart = len(line) - 1 - maxlinelen
194 if line[stop - 2] == '=':
195 append(line[start:stop - 1])
197 elif line[stop - 1] == '=':
198 append(line[start:stop])
201 append(line[start:stop] + '=')
204 # handle rest of line, special case if line ends in whitespace
205 if line and line[-1] in ' \t':
208 # It's a whitespace character at end-of-line, and we have room
210 q = quote(line[-1])
213 q = line[-1] + soft_break
216 # will be the only content on the subsequent line.
217 q = soft_break + quote(line[-1])
218 append(line[start:-1] + q)
220 append(line[start:])
244 for line in encoded.splitlines():
245 line = line.rstrip()
246 if not line:
251 n = len(line)
253 c = line[i]
257 # Otherwise, c == "=". Are we at the end of the line? If so, add
258 # a soft line break.
263 elif i+2 < n and line[i+1] in hexdigits and line[i+2] in hexdigits:
264 decoded += unquote(line[i:i+3])