Mercurial > p > roundup > code
comparison roundup/mailgw.py @ 1604:f2bdf6b07c2a
email file attachments added to issue files list [SF#711501]
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Wed, 23 Apr 2003 12:10:51 +0000 |
| parents | 4074e2336eed |
| children | e109d59f232d |
comparison
equal
deleted
inserted
replaced
| 1602:a3442208867f | 1604:f2bdf6b07c2a |
|---|---|
| 71 set() method to add the message to the item's spool; in the second case we | 71 set() method to add the message to the item's spool; in the second case we |
| 72 are calling the create() method to create a new node). If an auditor raises | 72 are calling the create() method to create a new node). If an auditor raises |
| 73 an exception, the original message is bounced back to the sender with the | 73 an exception, the original message is bounced back to the sender with the |
| 74 explanatory message given in the exception. | 74 explanatory message given in the exception. |
| 75 | 75 |
| 76 $Id: mailgw.py,v 1.116 2003-04-17 06:51:44 richard Exp $ | 76 $Id: mailgw.py,v 1.117 2003-04-23 12:09:20 richard Exp $ |
| 77 ''' | 77 ''' |
| 78 | 78 |
| 79 import string, re, os, mimetools, cStringIO, smtplib, socket, binascii, quopri | 79 import string, re, os, mimetools, cStringIO, smtplib, socket, binascii, quopri |
| 80 import time, random, sys | 80 import time, random, sys |
| 81 import traceback, MimeWriter, rfc822 | 81 import traceback, MimeWriter, rfc822 |
| 815 for (name, mime_type, data) in attachments: | 815 for (name, mime_type, data) in attachments: |
| 816 if not name: | 816 if not name: |
| 817 name = "unnamed" | 817 name = "unnamed" |
| 818 files.append(self.db.file.create(type=mime_type, name=name, | 818 files.append(self.db.file.create(type=mime_type, name=name, |
| 819 content=data, **file_props)) | 819 content=data, **file_props)) |
| 820 # attach the files to the issue | |
| 821 if nodeid: | |
| 822 # extend the existing files list | |
| 823 fileprop = cl.get(nodeid, 'file') | |
| 824 fileprop.extend(files) | |
| 825 props['files'] = fileprop | |
| 826 else: | |
| 827 # pre-load the files list | |
| 828 props['files'] = fileprop | |
| 829 | |
| 820 | 830 |
| 821 # | 831 # |
| 822 # create the message if there's a message body (content) | 832 # create the message if there's a message body (content) |
| 823 # | 833 # |
| 824 if content: | 834 if content: |
