1 | n/a | # Copyright (C) 2002-2006 Python Software Foundation |
---|
2 | n/a | # Author: Barry Warsaw |
---|
3 | n/a | # Contact: email-sig@python.org |
---|
4 | n/a | |
---|
5 | n/a | """Base class for MIME type messages that are not multipart.""" |
---|
6 | n/a | |
---|
7 | n/a | __all__ = ['MIMENonMultipart'] |
---|
8 | n/a | |
---|
9 | n/a | from email import errors |
---|
10 | n/a | from email.mime.base import MIMEBase |
---|
11 | n/a | |
---|
12 | n/a | |
---|
13 | n/a | |
---|
14 | n/a | class MIMENonMultipart(MIMEBase): |
---|
15 | n/a | """Base class for MIME non-multipart type messages.""" |
---|
16 | n/a | |
---|
17 | n/a | def attach(self, payload): |
---|
18 | n/a | # The public API prohibits attaching multiple subparts to MIMEBase |
---|
19 | n/a | # derived subtypes since none of them are, by definition, of content |
---|
20 | n/a | # type multipart/* |
---|
21 | n/a | raise errors.MultipartConversionError( |
---|
22 | n/a | 'Cannot attach additional subparts to non-multipart/*') |
---|