| 
									
										
										
										
											2006-04-21 10:40:58 +00:00
										 |  |  |  | # Copyright (C) 2002-2006 Python Software Foundation | 
					
						
							| 
									
										
										
										
											2004-10-03 03:16:19 +00:00
										 |  |  |  | # Author: Barry Warsaw | 
					
						
							|  |  |  |  | # Contact: email-sig@python.org | 
					
						
							| 
									
										
										
										
											2002-06-01 05:59:12 +00:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-10-03 03:16:19 +00:00
										 |  |  |  | """Base class for MIME type messages that are not multipart.""" | 
					
						
							| 
									
										
										
										
											2002-06-01 05:59:12 +00:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-04-21 10:40:58 +00:00
										 |  |  |  | __all__ = ['MIMENonMultipart'] | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | from email import errors | 
					
						
							|  |  |  |  | from email.mime.base import MIMEBase | 
					
						
							| 
									
										
										
										
											2002-06-01 05:59:12 +00:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |  | 
					
						
							| 
									
										
										
										
											2006-04-21 10:40:58 +00:00
										 |  |  |  | class MIMENonMultipart(MIMEBase): | 
					
						
							| 
									
										
										
										
											2002-06-01 05:59:12 +00:00
										 |  |  |  |     """Base class for MIME multipart/* type messages.""" | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2002-09-28 20:25:15 +00:00
										 |  |  |  |     __pychecker__ = 'unusednames=payload' | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2002-06-01 05:59:12 +00: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-04-21 10:40:58 +00:00
										 |  |  |  |         raise errors.MultipartConversionError( | 
					
						
							| 
									
										
										
										
											2002-06-01 05:59:12 +00:00
										 |  |  |  |             'Cannot attach additional subparts to non-multipart/*') | 
					
						
							| 
									
										
										
										
											2002-09-28 20:25:15 +00:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  |     del __pychecker__ |