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