Barry Warsaw | 2f514a8 | 2002-06-01 05:59:12 +0000 | [diff] [blame] | 1 | # Copyright (C) 2002 Python Software Foundation |
| 2 | # Author: barry@zope.com (Barry Warsaw) |
| 3 | |
| 4 | """Base class for MIME type messages that are not multipart. |
| 5 | """ |
| 6 | |
| 7 | from email import Errors |
| 8 | from email import MIMEBase |
| 9 | |
| 10 | |
| 11 | |
| 12 | class MIMENonMultipart(MIMEBase.MIMEBase): |
| 13 | """Base class for MIME multipart/* type messages.""" |
| 14 | |
| 15 | def attach(self, payload): |
| 16 | # The public API prohibits attaching multiple subparts to MIMEBase |
| 17 | # derived subtypes since none of them are, by definition, of content |
| 18 | # type multipart/* |
| 19 | raise Errors.MultipartConversionError( |
| 20 | 'Cannot attach additional subparts to non-multipart/*') |