blob: 1b3bcfd353a01e1e27e9e3e1f9bb5d9bca4299a6 [file] [log] [blame]
Barry Warsaw2f514a82002-06-01 05:59:12 +00001# 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
7from email import Errors
8from email import MIMEBase
9
10
11
12class MIMENonMultipart(MIMEBase.MIMEBase):
13 """Base class for MIME multipart/* type messages."""
14
Barry Warsaw5f253272002-09-28 20:25:15 +000015 __pychecker__ = 'unusednames=payload'
16
Barry Warsaw2f514a82002-06-01 05:59:12 +000017 def attach(self, payload):
18 # The public API prohibits attaching multiple subparts to MIMEBase
19 # derived subtypes since none of them are, by definition, of content
20 # type multipart/*
21 raise Errors.MultipartConversionError(
22 'Cannot attach additional subparts to non-multipart/*')
Barry Warsaw5f253272002-09-28 20:25:15 +000023
24 del __pychecker__