Mercurial > repos > rliterman > csp2
annotate CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/lib/python3.8/email/mime/nonmultipart.py @ 68:5028fdace37b
planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author | jpayne |
---|---|
date | Tue, 18 Mar 2025 16:23:26 -0400 |
parents | |
children |
rev | line source |
---|---|
jpayne@68 | 1 # Copyright (C) 2002-2006 Python Software Foundation |
jpayne@68 | 2 # Author: Barry Warsaw |
jpayne@68 | 3 # Contact: email-sig@python.org |
jpayne@68 | 4 |
jpayne@68 | 5 """Base class for MIME type messages that are not multipart.""" |
jpayne@68 | 6 |
jpayne@68 | 7 __all__ = ['MIMENonMultipart'] |
jpayne@68 | 8 |
jpayne@68 | 9 from email import errors |
jpayne@68 | 10 from email.mime.base import MIMEBase |
jpayne@68 | 11 |
jpayne@68 | 12 |
jpayne@68 | 13 |
jpayne@68 | 14 class MIMENonMultipart(MIMEBase): |
jpayne@68 | 15 """Base class for MIME non-multipart type messages.""" |
jpayne@68 | 16 |
jpayne@68 | 17 def attach(self, payload): |
jpayne@68 | 18 # The public API prohibits attaching multiple subparts to MIMEBase |
jpayne@68 | 19 # derived subtypes since none of them are, by definition, of content |
jpayne@68 | 20 # type multipart/* |
jpayne@68 | 21 raise errors.MultipartConversionError( |
jpayne@68 | 22 'Cannot attach additional subparts to non-multipart/*') |