Lines Matching defs:write

42         must have a write() method.
69 def write(self, s):
71 self._fp.write(s)
116 self.write(ufrom + self._NL)
133 # Note that we use 'self.write' when what we are writing is coming from
134 # the source, and self._fp.write when what we are writing is coming from a
136 # the data in its write method in that case). This is an entirely
138 # always using write and having the Bytes subclass write method detect when
156 self.write(line)
157 self.write(self._NL)
159 self.write(lines[-1])
164 # self.write(self._NL)
167 # We can't write the headers yet because of the following scenario:
169 # its body. We'd have to calculate the new boundary /before/ we write
170 # the headers so that we can write the correct Content-Type:
174 # is to cache any subpart writes into a buffer. The we write the
203 self._fp.write(sfp.getvalue())
227 self.write(self.policy.fold(h, v))
229 self.write(self._NL)
260 # The trick here is to write out each part separately, merge them all
269 self.write(subparts)
287 # If there's a preamble, write it out, with a trailing CRLF
294 self.write(self._NL)
296 self.write('--' + boundary + self._NL)
299 self._fp.write(msgtexts.pop(0))
305 self.write(self._NL + '--' + boundary + self._NL)
307 self._fp.write(body_part)
309 self.write(self._NL + '--' + boundary + '--' + self._NL)
329 # We can't just write the headers directly to self's file object
347 self._fp.write(self._encoded_NL.join(blocks))
355 # write it out.
367 self._fp.write(payload)
408 The outfp object must accept bytes in its write method.
411 def write(self, s):
412 self._fp.write(s.encode('ascii', 'surrogateescape'))
424 self._fp.write(self.policy.fold_binary(h, v))
426 self.write(self._NL)
430 # just write it back out.