source: python/trunk/Lib/email/mime/nonmultipart.py

Last change on this file was 391, checked in by dmik, 11 years ago

python: Merge vendor 2.7.6 to trunk.

  • Property svn:eol-style set to native
File size: 689 bytes
Line 
1# Copyright (C) 2002-2006 Python Software Foundation
2# Author: Barry Warsaw
3# Contact: email-sig@python.org
4
5"""Base class for MIME type messages that are not multipart."""
6
7__all__ = ['MIMENonMultipart']
8
9from email import errors
10from email.mime.base import MIMEBase
11
12
13
14
15class MIMENonMultipart(MIMEBase):
16 """Base class for MIME multipart/* type messages."""
17
18 def attach(self, payload):
19 # The public API prohibits attaching multiple subparts to MIMEBase
20 # derived subtypes since none of them are, by definition, of content
21 # type multipart/*
22 raise errors.MultipartConversionError(
23 'Cannot attach additional subparts to non-multipart/*')
Note: See TracBrowser for help on using the repository browser.