2006-03-18 11:41:53 -04:00
|
|
|
|
# Copyright (C) 2002-2006 Python Software Foundation
|
2004-10-03 00:16:19 -03:00
|
|
|
|
# Author: Barry Warsaw
|
|
|
|
|
# Contact: email-sig@python.org
|
2002-06-01 02:59:12 -03:00
|
|
|
|
|
2004-10-03 00:16:19 -03:00
|
|
|
|
"""Base class for MIME type messages that are not multipart."""
|
2002-06-01 02:59:12 -03:00
|
|
|
|
|
2006-03-18 11:41:53 -04:00
|
|
|
|
__all__ = ['MIMENonMultipart']
|
|
|
|
|
|
|
|
|
|
from email import errors
|
|
|
|
|
from email.mime.base import MIMEBase
|
2002-06-01 02:59:12 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-03-18 11:41:53 -04:00
|
|
|
|
class MIMENonMultipart(MIMEBase):
|
2014-10-02 07:35:08 -03:00
|
|
|
|
"""Base class for MIME non-multipart type messages."""
|
2002-06-01 02:59:12 -03:00
|
|
|
|
|
|
|
|
|
def attach(self, payload):
|
|
|
|
|
# The public API prohibits attaching multiple subparts to MIMEBase
|
|
|
|
|
# derived subtypes since none of them are, by definition, of content
|
|
|
|
|
# type multipart/*
|
2006-03-18 11:41:53 -04:00
|
|
|
|
raise errors.MultipartConversionError(
|
2002-06-01 02:59:12 -03:00
|
|
|
|
'Cannot attach additional subparts to non-multipart/*')
|