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

Method _write_lines

Lib/email/generator.py:151–165  ·  view source on GitHub ↗
(self, lines)

Source from the content-addressed store, hash-verified

149 return s
150
151 def _write_lines(self, lines):
152 # We have to transform the line endings.
153 if not lines:
154 return
155 lines = NLCRE.split(lines)
156 for line in lines[:-1]:
157 self.write(line)
158 self.write(self._NL)
159 if lines[-1]:
160 self.write(lines[-1])
161 # XXX logic tells me this else should be needed, but the tests fail
162 # with it and pass without it. (NLCRE.split ends with a blank element
163 # if and only if there was a trailing newline.)
164 #else:
165 # self.write(self._NL)
166
167 def _write(self, msg):
168 # We can't write the headers yet because of the following scenario:

Callers 3

_handle_textMethod · 0.95
_handle_multipartMethod · 0.95
_handle_textMethod · 0.80

Calls 2

writeMethod · 0.95
splitMethod · 0.45

Tested by

no test coverage detected