def _process_attachments(self, email):
for a in email.attachments:<EOL><INDENT>if isinstance(a, MIMEBase):<EOL><INDENT>if not a.is_multipart():<EOL><INDENT>obj = {<EOL>'<STR_LIT:filename>': a.get_filename(),<EOL>'<STR_LIT>': a.get_content_type(),<EOL>}<EOL>if a.get('<STR_LIT>') == '<STR_LIT>':<EOL><INDENT>obj['<STR_LIT:content>'] = a.get_payload()<EOL>obj['<STR_LIT>'] = True<EOL><DEDENT>else:<EOL><INDENT>obj['<STR_LIT:content>'] = a.get_payload(decode=True)<EOL><DEDENT>yield obj<EOL><DEDENT><DEDENT>else:<EOL><INDENT>yield {<EOL>'<STR_LIT:filename>': a[<NUM_LIT:0>],<EOL>'<STR_LIT>': a[<NUM_LIT:2>],<EOL>'<STR_LIT:content>': a[<NUM_LIT:1>],<EOL>}<EOL><DEDENT><DEDENT>
Convert the attachments in the email to the appropriate format for
sending with Connection.send().