Iterate over the parts, returning string payloads line-by-line. Optional decode (default False) is passed through to .get_payload().
(msg, decode=False)
| 30 | |
| 31 | # These two functions are imported into the Iterators.py interface module. |
| 32 | def body_line_iterator(msg, decode=False): |
| 33 | """Iterate over the parts, returning string payloads line-by-line. |
| 34 | |
| 35 | Optional decode (default False) is passed through to .get_payload(). |
| 36 | """ |
| 37 | for subpart in msg.walk(): |
| 38 | payload = subpart.get_payload(decode=decode) |
| 39 | if isinstance(payload, str): |
| 40 | yield from StringIO(payload) |
| 41 | |
| 42 | |
| 43 | def typed_subpart_iterator(msg, maintype='text', subtype=None): |
nothing calls this directly
no test coverage detected
searching dependent graphs…